Skip to content

Instantly share code, notes, and snippets.

@raynerpupo
Created April 18, 2018 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raynerpupo/004df7a0715866cf22a60fcca209c74b to your computer and use it in GitHub Desktop.
Save raynerpupo/004df7a0715866cf22a60fcca209c74b to your computer and use it in GitHub Desktop.

Coercion

Coercion is an implicit conversion of types:

// amount is a number
var amount = 32;

// since " years" is a string there is a implicit conversion of amount to string
var age = amount + " years";
console.log(age); // => 32 years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment