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()


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -