Confusing addition and concatenation
An addition is about adding numbers and concatenation is about adding strings. In JavaScript, both operations use the same ‘+’ operator. Because of this, adding a number as a number will produce a different result from adding a number as a string and a lot of beginners have confusion about this.
Example:
javascript
// the result in x is 30 let x = 5 + 25; // the result in x is '525' let x = 5 + '25' ; |
JavaScript Common Mistakes
JavaScript is an easy language to get started with, but achieving mastery takes a lot of effort, time, and patience. Beginners often make a few well-known mistakes.
In this article, we’ll cover some of the most common learning mistakes people make and find out how to overcome them. Many of these tips will be applicable outside of JavaScript or even web development.
Contact Us