Type coercion is the automatic conversion of values from one data type to another during certain operations or comparisons.

 

coercion is used during concatenation

coercion is used during comparisons

 

let string = "42"
let number = 41
let boolean = true
let nullValue = null

string + number
// 4241

number + boolean
// 42



 

Comparisons using ==  ===