I'm learning javascript and after reading a tutorial on how to initialize an object, I found the following example:
var obj = { property_1: value_1, // property_# may be an identifier...
2: value_2, // or a number...
// ...,
"property n": value_n }; // or a string
My doubt is in the property with a number as a name. I understand this, but I can't find a real benefice of using it. I read this question and, from my point of view, this kind of notation could lead to bad design or an unnecessary complexity in my code, so I would like to know why this syntax exist.
Do this kind of declaration is used frequently? In what kind of scenarios this could be an ideal alternative?