I am new to javascript and I've been wondering about something. Is there an accepted way I should be listing my object properties?
To be specific, I have been writing code where an object is created without any initial properties and adding them on as the code runs.
Example:
Game = {};
Game.x = 0;
...Code code code
Game.thing = function () {
Game.variable = 30;
}
As you can see, my Game object is just slowly gathering properties as my code runs on. Is this acceptable? Or should I be listing out all the properties I will be using at the beginning in my Game object initialization? Thanks.