Answers for "how to loop into a map"

4

loop through map in js

const object = {'a': 1, 'b': 2, 'c' : 3};
for (const [key, value] of Object.entries(object)) {
  console.log(key, value);
}
Posted by: Guest on April-07-2020
0

map looping

showDetails(cards, id){
  cards.map(function(card, index){
    if(card.id==id){
      console.log(card);
      return card;
    }
  })
}
Posted by: Guest on January-14-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language