Skip to content

Instantly share code, notes, and snippets.

@tranduclinh2067
Created November 1, 2018 15:06
Show Gist options
  • Select an option

  • Save tranduclinh2067/267bb2487210309e062d59699df7f966 to your computer and use it in GitHub Desktop.

Select an option

Save tranduclinh2067/267bb2487210309e062d59699df7f966 to your computer and use it in GitHub Desktop.
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());
@tranduclinh2067
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment