jquery - Looping over strings in JSON -
my json looks this:
{"roomnolist":[{"roomno":"ml100"},{"roomno":"ml100"},{"roomno":"ml100"},{"roomno":"ml100"}]}
i want loop on strings , roomno
values.
this should job in modern browsers:
var numbers = obj.roomnolist.map(function(item) { return item.roomno; };
with jquery:
var numbers = $.map(obj.roomnolist, function(item) { return item.roomno; });
see also: jquery.map()
array.map()