Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to loop through an object in JavaScript with the Object.values() method

const population = {
  male: 4,
  female: 93,
  others: 10
};

let numbers = Object.values(population);

console.log(numbers); // [4,93,10]
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #loop #object #JavaScript #method
ADD COMMENT
Topic
Name
9+5 =