
Common Errors in JavaScript - martahackages
https://blog.hackages.io/spot-the-mistake-daaa04f7e554
======
lioeters
The article itself seems to contain an error.

The author states that the following:

typeof result !== 'number'

..returns "Boolean" because it's interpreted as:

typeof (result !== 'number')

I don't believe this is true. typeof has precedence over in/equality [0], so
you don't need parantheses, as recommended in the article, like
typeof(result). The original statement works as expected.

[0] [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)

~~~
lioeters
I did enjoy reading the article though, so thank you for writing and posting
it!

