constname='bob';constlastName='sprinklebutt';constfullName=name+''+lastName;// Here, name is contatenated with lastName to create a new string
Conversion:
constnumString='1234';constnum=Number(numString);// Convert string to a number
Coercion:
conststringNumber='12';constnum=12;constcoerced=stringNumber+num;// Results in "1212"true==1;// true
Type coercion is the process of converting value from one type to another (such as string to number, object to boolean, and so on). Any type, be it primitive or an object, is a valid subject for type coercion.
Exerpt from freecodecamp.org/news/js-type-coer...
Concatenation:
Conversion:
Coercion:
Truthy and Falsy:
This is a weird one in JS
Hope it's useful
thanks man for this,
i really appreciate.
This is a great explanation right here.
thanks for this,
very simple to understand
wow,
thanks for this
Thanks for this..
i really appreciate