multiply array js code example
Example 1: javascript multiply array with scalar
var input = [3, 6, 4];
var scalar = 5;
var output = input.map(x => x * scalar); // [15, 30, 20]
Example 2: multiply function javascript
// MULTIPLY FUNCTION
const multiply = (num1, num2) => {
return num1 * num2;
};
let resulMultiply = multiply(4, 5);
console.log(resulMultiply);
// 20