Created
March 13, 2018 04:43
-
-
Save haingdc/5feba6692e0f3a8b50c8aeb049ca8565 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 3
This file contains hidden or 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
var thing = 'bat'; | |
var sing = function() { | |
// Bên trong ‘sing’ có thể thấy biến line | |
var line = 'Twinkle, twinkle, little ' + thing; | |
console.log(line); | |
}; | |
sing(); | |
// Twinkle, twinkle, little bat | |
// Bên ngoài ‘sing’, chúng ta không thể thấy biến line | |
console.log(line); | |
// ⛔ Uncaught ReferenceError: line is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment