Everyday Health Group interview question

How can you find if two numbers are equal without using comparative operators.

Interview Answer

Anonymous

12 Mar 2020

For equal numbers, function will return true else output would be false. function equal(a,b){ return !(a-b); } var x = equal(3,3); console.log(x);