D
d.adamkiewicz
Hello Folks
I was wondering if the following could be better written:
var myObject = {};
/*
in this case explicit declaration seems to be mandatory
otherwise 'myObject.ala has no properties' error occurs
*/
if (typeof myObject["ala"] == "undefined") {
myObject["ala"] = [];
}
myObject["ala"].push("ela");
Regards
Darek
I was wondering if the following could be better written:
var myObject = {};
/*
in this case explicit declaration seems to be mandatory
otherwise 'myObject.ala has no properties' error occurs
*/
if (typeof myObject["ala"] == "undefined") {
myObject["ala"] = [];
}
myObject["ala"].push("ela");
Regards
Darek