Created a multidimensional array on jQuery:
var shed = {}; shed['half-round'] = { '2100': { '2500': { 'wo-polycarbonate':16300, 'polycarbonate':21300 }, '3000': { 'wo-polycarbonate':17900, 'polycarbonate':22900 }, '3500': { 'wo-polycarbonate':21600, 'polycarbonate':26600 }, '4000': { 'wo-polycarbonate':22700, 'polycarbonate':27700 }, '4500': { 'wo-polycarbonate':24800, 'polycarbonate':29900 }, '5000': { 'wo-polycarbonate':25900, 'polycarbonate':31000 }, '5500': { 'wo-polycarbonate':27600, 'polycarbonate':32700 }, '6000': { 'wo-polycarbonate':28700, 'polycarbonate':39300 } } }
Does jQuery know how to select data and how many elements are in each element? For example - I want to know how many elements in the element 2100, I request length
- it is reported that no such function was found.
It seems that only the "until the very last tail" sampling algorithm works, for example:
alert(shed['half-round'][2100][2500]['wo-polycarbonate']);
which gives the farthest branch value = 16300 ...
View requests:
shed['half-round'][2100][2500].length shed['half-round'][2100].length shed.length shed['half-round'][2100][0] shed['half-round'][0]
Somehow difficult to implement?
I use jquery 2.1.4.
PS: like people compares JSON with the XML format and proves that it is absolutely possible to use it.
Object.keys()
- Pavel Mayorov