Why JavaScript ‘seems’ to get addition wrong


Introduction JavaScript is a dynamic weakly-typed language so it's possible to have expressions like this: This post explains how JavaScript evaluates such complex 'mix-n-matches' and at the end of this, you should know why foo is NaN. First, a screenshot showing more funny behaviour: A brief Maths Refresher Associativity The result of the mathematical operation is always same regardless of … Continue reading Why JavaScript ‘seems’ to get addition wrong