Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function multiplyOrDivide(arr) {
- let num1 = Number(arr[0]);
- let num2 = Number(arr[1]);
- if (num1 > num2) {
- console.log(num1 / num2);
- }
- else {
- console.log(num1 * num2);
- }
- }
- //multiplyOrDivide(['6', '3']); 6 / 3 = 2
- //multiplyOrDivide(['2', '3']); 2 * 3 = 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement