Combined Comparison / “Spaceship” Operator () in Javascript?

As far as I know there is no such operator in JavaScript but you can use Math.sign() function:

Math.sign(a - b);

NOTE: As was mentioned in comments, Math.sign() is not currently supported by all browsers. Check for compatibility (MDN).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)