Advertisement
Militsa

04. Product of 3 Numbers

Dec 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function positiveOrNegative(arr) {
  2.     let num1 = Number(arr[0]);
  3.     let num2 = Number(arr[1]);
  4.     let num3 = Number(arr[2]);
  5.     let sum = num1 * num2 * num3;
  6.  
  7.     if (sum >= 0){
  8.         console.log("Positive");
  9.     }
  10.     else {
  11.         console.log("Negative");
  12.     }
  13. }
  14.  
  15. //positiveOrNegative(['2','3','-1']); Negative
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement