Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JSON - Accessing a numeric property

0 votes
2 views
added Jul 4 in API by LC Marshal Lieutenant (12,590 points)
edited Jul 13 by LC Marshal
var myObject = { '0' : 'blue', 'satu' : 'red' };

//Usually, to access the property with:
myObject.0 //this is usually not working
myObject.satu //this is ok, because its not numeric

//use this instead
(myObject["0"] is an alternative syntax for myObject.0.

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...