Answers for "how to iterate through a stringified json array in javascript"

0

how to iterate through a stringified json array in javascript

// Suppose the following is the stringified array :

let array = [{
  name : 'name1'
},
 {
   name : 'name2'
},
 {
   name : 'name3'  
}]

// We can use for-of loop to get the value of the key name:

for(key of array){
  console.log(key.name)
}

// we can also use for-each loop here :

array.forEach((element)=>{
  console.log(element.name)
})
Posted by: Guest on September-22-2021
0

iterate json object array in javascript

//Iterate through arraylist object and put it to a separate array object
$.each(arrayListOutput,function(i,v){
_temp=[];
_temp.push(arrayListOutput[i][0]);

});
Posted by: Guest on June-15-2021

Code answers related to "how to iterate through a stringified json array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language