I wish to create a Javascript object with nested variables where some of the variables will not have a default value specified.
I currently have this:
va
You need to specify a value for globalVarC
else the javascript syntax for json will be wrong, since you do not have any value to initialize you can give the value undefined.
undefined
is a global variable with primitive value undefined.
var myObject = {
GlobalVars: {
globalVarA: "foo",
globalVarB: "bar",
globalVarC: undefined
},
myFunction: function(){
//do something
}
}