⏱ 0:02est. 2 min
Chapter 24- Conceptual Aside (Coercion)
Notes
#BIGWORD Coercion - Converting a value from one type to another. This happens quite often in javascript because it's dynamically typed.
Example 1
var a = 1+2;
console.log(a); //3
------------------------------------------------------------------------------------------
Example 2
var a = "Hello "+ "World";
console.log(a); //Hello World
------------------------------------------------------------------------------------------
Example 3
var a = 1 + "2";
console.log(a); //12 Coerced 1 from number to string