DEV Community

Discussion on: More JavaScript Mistakes You May be Making

Collapse
 
fref profile image
Fredrik Fall

Nice article!

To add to the part about addition/concatenation, the underlying problem
is javascript's automatic type-convertions. The basis for the infamous "WAT" video on youtube (recommended).

String concatenation is also being replaced by template literals for projects employing the newer ES versions.

Collapse
 
aumayeung profile image
John Au-Yeung

Yea. Type coercion is tricky. I think we just have to convert everything to the same type so that we won't make mistakes with we apply operators to them.

Some comments have been hidden by the post's author - find out more