Write a JS function that calculates the product of two numbers. The input comes as two number arguments. The output should be the returned as a result of your function.
Examples:
Input: 3 2 Output: 6
Input: 23632.36 -12.3249 Output: -291266.473764
Here's my solution:
function multiplyTwoNumbers(a, b) { let result = a * b; console.log(result); } multiplyTwoNumbers(2, 3);
My code:
function mult(nums) { let result = Number(nums[0]) * Number(nums[1]); console.log(result); } mult(["23632.36", "-12.3249"]);
function mNumbers([num1,num2]) { console.log(num1 * num2); } mNumbers(["5", "7"]);
622 questions
979 answers
129 comments
53 users