jquery - Is this a javascript array with objects in it? -
square brackets array, , curly brackets objects correct?
what data structure:
some.thing = [ { "swatch_src" : "/images/91388044000.jpg", "color" : "black multi", "inventory" : { "f" : [ 797113, 797114 ], "x" : [ 797111, 797112 ] }, "images" : [ { "postfix" : "jpg?53_1291146215000", "prefix" : "/images/share/uploads/0000/0000/5244/52445892" }, { "postfix" : "jpg?53_1291146217000", "prefix" : "/images/share/uploads/0000/0000/5244/52445904" }, { "postfix" : "jpg?53_1291146218000", "prefix" : "/images/share/uploads/0000/0000/5244/52445909" } ], "skus" : [ { "sale_price" : 199, "sku_id" : 797111, "msrp_price" : 428, "size" : "s" }, { "sale_price" : 199, "sku_id" : 797112, "msrp_price" : 428, "size" : "m" }, { "sale_price" : 199, "sku_id" : 797113, "msrp_price" : 428, "size" : "l" }, { "sale_price" : 199, "sku_id" : 797114, "msrp_price" : 428, "size" : "xl" } ], "look_id" : 37731360 } ];;
yes, array of objects nested arrays within. (or in case 1 single element contained within array.)
some.thing[0]
refers have listed. there, have object containing:
var obj = some.thing[0]; obj.swatch_src // contains "/images/91388044000.jpg" obj.color // contains "black multi" ... obj.inventory // (another object obj.inventory.f // array of [797113, 797114] ... obj.images // array of objects obj.images[0].postfix // contains "jpg?53_1291146215000" obj.images[0].prefix // contains "/images/share/uploads/0000/0000/5244/52445892" ...
Comments
Post a Comment