Skip to content

Instantly share code, notes, and snippets.

@btg5679
Created October 9, 2017 13:57
Show Gist options
  • Save btg5679/f0f456357ec8571f599e7d6ccbec2308 to your computer and use it in GitHub Desktop.
Save btg5679/f0f456357ec8571f599e7d6ccbec2308 to your computer and use it in GitHub Desktop.
//Explicit vs. Implicit Coercion in JS
let a = 100;
let b = a + ''; //IMPLICIT COERCION
console.log(b) //'100'
let c = String ( a ) //EXPLICIT COERCION
console.log(c) //'100'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment