Good day,
I have a simple question (I hope). How do I access the array of “LOCATION_LOOKUP_DATA” within the following code?
(Wonder.Way.Communities = function() {
var CONSTANTS = {
LOCATION_LOOKUP_DATA :["Yonkers (10710)","Yorktown Heights (10598)"]
}
}
)
I am trying to replace the array of LOCATION_LOOKUP_DATA with new data so I need to access that array. Here are some of the checks I’ve tried, and the results
alert($(Wonder.Way.Communities).data()); -returns [object Object]
alert(Wonder.Way.Communities[0]); - returns [undefined]
alert($(Wonder.Way.Communities).CONSTANTS[0]; returns [Cannot read property '0' of undefined]
Create an accessor function at the same scope level as CONSTANTS, which will have access to the CONSTANTS object.