Answers for "array multiplication javascript"

2

multiply arrays javascript

var sum = 0;
for(var i=0; i< arr1.length; i++) {
    sum += arr1[i]*arr2[i];
}
Posted by: Guest on August-21-2021
1

javascript multiply array with scalar

var input = [3, 6, 4];
var scalar = 5;
var output = input.map(x => x * scalar); // [15, 30, 20]
Posted by: Guest on May-20-2020

Code answers related to "array multiplication javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language