javascript - How to make a nest loop to loop through 2 phone numbers? -


{ "_id" : objectid("..."), "name" : "jrose", "phonenumbers" : [ {     "type" : "home",     "value" : "18005550000" }, {     "type" : "work",     "value" : "18004339919" }], "callerid" : ["..."], "pin" : "...", "usesms" : true } 

this created in mongodb, if curious. wondering nested loop loop through these 2 numbers.

phonenumbers array containing objects, iterate array:

for (var = 0; < doc.phonenumbers.length; i++) {     console.log(doc.phonenumbers[i].value); } 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -