Here are two cases:
console.log(Math.abs(-16) % 2 === 0) //true
console.log(Math.abs(-16) % 2 === -0) //true
In the second case, isn't Math.abs()
supposed to change -16 into 16, therefore making it return false
because 16 % 2 !== -0
?
Also how can i solve it so that the second case (console.log(Math.abs(-16) % 2 === -0)
) doesn't return true
, instead, false