Created
November 1, 2018 15:06
-
-
Save tranduclinh2067/267bb2487210309e062d59699df7f966 to your computer and use it in GitHub Desktop.
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
fun_1 =(n)=> { | |
let varr =n; | |
return () => { | |
return varr; | |
}; | |
} | |
var a = fun_1(1); | |
var b = fun_1(2); | |
console.log(a()); | |
console.log(b()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trong hàm fun_1, khi gọi varr(1) kết quả sẽ là 1, còn khi gọi varr(2) kết quả sẽ là 2.