Answers for "first element is index and second element is array in javascript loop"

3

array index javascript show only first 2 elements

array.slice(0, n);
Posted by: Guest on January-21-2020
0

Getting One Value from an Array of Items

//Getting One Value from an Array of Items or sum of array
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var total = numbers.reduce(function(total, current) {
    return total + current;
}, 0);

console.log(total);
Posted by: Guest on July-10-2020

Code answers related to "first element is index and second element is array in javascript loop"

Code answers related to "Javascript"

Browse Popular Code Answers by Language