Skip to content

Instantly share code, notes, and snippets.

@showlovezz
Last active February 9, 2020 13:14
Show Gist options
  • Save showlovezz/17d0509e49b3203c0689545e12bc0300 to your computer and use it in GitHub Desktop.
Save showlovezz/17d0509e49b3203c0689545e12bc0300 to your computer and use it in GitHub Desktop.
鼠年全馬鐵人挑戰 - 1-1
var status = 'failed'; // 全域變數
function getStatus() {
var status = 'ok'; // 區域變數
return status
}
console.log(getStatus())
console.log(status)
// 從第一行到第七行稱為全域範圍
// 從第二行到第五行稱為區域範圍
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment