I have an object that stores 3 variables called text0, text1 and text2
that in turn store one string each. I also have a variable that stores the index of the clicked button, so that if I click on the third button it should fetch the text2
.
I was trying something like this:
p.text(myObj.text + btnNumber);
But so far all I get is NaN. Is it even possible to do this way? What am I missing?