Call method dynamically based on variable name

37 Views Asked by At

I currently have a generated XBase object with some method names:

get_0(), get_1(), get_...(), get_50()

Now I'd like to call them with a loop instead of 50 lines, like this

for(var i = 0; i <= 50; i++) {

   fiftyGetters.get_ + i // 

}

How can I achieve this in XBase/XText?

0

There are 0 best solutions below