Type Coercion In JavaScript π
This small blog was sparked by a post that I saw: There are many posts like the above on the internet, and almost all of them are because of this type coercion thingy. So in this blog, Iβm gonna try to explain what type coercion is and whatβs happening in that post π. What is type coercion? There are 6 primitive data types in JavaScript: undefined, Boolean, Number, String, BigInt and Symbol. When you try to do things like adding two different data types together, JavaScript uses some rules to decide how itβs gonna coerce one type into the other type, to actually add them together. ...