Answers for "what is the modern syntax for iterating through array using for loop in javascript"

0

how to get value in array object value using for loop in javascript

const people = [ {name: "john", age:23},
                {name: "john", age:43},
                {name: "jim", age:101},
                {name: "bob", age:67} ];

const john = people.find(person => person.name === 'john');
console.log(john);
Posted by: Guest on May-11-2020
0

how to get value in array object value using for loop in javascript

const myArray = [{x:100}, {x:200}, {x:300}];

const sum = myArray.map(element => element.x).reduce((a, b) => a + b, 0);
console.log(sum); // 600 = 0 + 100 + 200 + 300

const average = sum / myArray.length;
console.log(average); // 200
Posted by: Guest on May-11-2020
0

what is the modern syntax for iterating through array using for loop in javascript

let friends=["jony","tom","Tejas"];
       friends.forEach(
           function f(i){
               console.log(i);
           }
       )
Posted by: Guest on July-03-2020
0

how to get value in array object value using for loop in javascript

const people = [ {name: "john", age:23},
                {name: "john", age:43},
                {name: "jim", age:101},
                {name: "bob", age:67} ];

const john = people.find(person => person.name === 'john');
console.log(john);
Posted by: Guest on May-11-2020
0

how to get value in array object value using for loop in javascript

const myArray = [{x:100}, {x:200}, {x:300}];

const sum = myArray.map(element => element.x).reduce((a, b) => a + b, 0);
console.log(sum); // 600 = 0 + 100 + 200 + 300

const average = sum / myArray.length;
console.log(average); // 200
Posted by: Guest on May-11-2020
0

what is the modern syntax for iterating through array using for loop in javascript

let friends=["jony","tom","Tejas"];
       friends.forEach(
           function f(i){
               console.log(i);
           }
       )
Posted by: Guest on July-03-2020

Code answers related to "what is the modern syntax for iterating through array using for loop in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language