Advertisement
dabidabidesh

wrongResult

Jun 11th, 2020
2,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wrongResult5 = (n1, n2, n3) => {
  2.   'use strict'
  3.  
  4.   const sign = (n1, n2, n3) => {
  5.     if ((n1 < 0 && n2 > 0 && n3 > 0) ||
  6.       (n1 > 0 && n2 < 0 && n3 > 0) ||
  7.       (n1 > 0 && n2 > 0 && n3 < 0) ||
  8.       (n1 < 0 && n2 < 0 && n3 < 0))
  9.       return false
  10.     else
  11.       return true
  12.   }
  13.  
  14.   console.log(sign(n1, n2, n3) ? 'Positive' : 'Negative')
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement