We're a place where coders share, stay up-to-date and grow their careers.
Same for
if(a!=123) // before // NOOBS if(a^123) // after // PRO
a^123 is not very clean IMO. Maybe a better one will be if(a !== 123)
a^123
if(a !== 123)
And it's not correct for decimal numbers.
Boolean(122^123) // true Boolean(123.1^123) // false -> is not correct, should be true 123.1 !== 123 Boolean(123^123) // false
Much better to use the !== operator.
!==
IMHO
if(a!=123) // before // NOOBS if(a!==123) // after // PRO
Also we should think this is something that someone who comes from another Programming Language won't understand easily, just for saving 1 character
Same for
a^123
is not very clean IMO. Maybe a better one will beif(a !== 123)
And it's not correct for decimal numbers.
Much better to use the
!==
operator.IMHO
Also we should think this is something that someone who comes from another Programming Language won't understand easily, just for saving 1 character