Given the following JavaScript data structure – how would you describe it?
BLA = {
date : 12345678,
layers : {
bottom : "bottomLayer"
},
numbers : [5,4,2,2,4],
start : function(){}
}
I would say the following about above data structure, do you agree?
It is an object literal called
BLA.BLAis initializted with 4 object members. The first one isdatewhich value is12345678and the second one is the memberlayerswhich recursively stores an literal itself:bottom:"bottomLayer". The third member is referenced asnumberswhich holds an array with 5 values. The last member is referenced asstartand its respective value is an anomyous function.
You’re right on track, except for this part which reads a little awkwardly:
Instead I would just describe it as an object literal itself:
layersis not really doing anything recursive; that’s not quite the appropriate term. But you clearly understand what the object is.