Created
May 3, 2016 07:29
-
-
Save mariyadiminsky/ff7a221eb68f762475e56dd35b5405ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When using var what do we get? | |
var bunny = "eat carrot"; | |
if(bunny) { | |
var bunny = "eat twig"; | |
console.log(bunny) // "eat twig" | |
} | |
console.log(bunny)// "eat twig" | |
// When using let what do we get? | |
let bunny = "eat carrot"; | |
if(bunny) { | |
let bunny = "eat twig"; | |
console.log(bunny) // "eat twig" | |
} | |
console.log(bunny)// "eat carrot" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment