We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I have a undefined object at the top of my page.
var paddelY = {};
Then IN the draw loop I define it (Otherwise I get an error that mouseY is undefined):
paddelY = {
1 : mouseY + height*0.03, //Number
2 : this[1] - height*0.00275 //NaN
};
however if I were to log paddelY[2] to the console it would be NaN. Please help!
Answers
http://stackoverflow.com/questions/32014797/why-does-this-object-property-return-nan/32014855#32014855 This fixed it.
Since
1
&2
are numerical indices, an array would be more appropriate than some raw object!Although I believe you did that b/c you didn't want a
0
index. ;)