Last active
February 9, 2020 13:29
-
-
Save showlovezz/6333512bb8c562de1ba590d57d93f6e2 to your computer and use it in GitHub Desktop.
鼠年全馬鐵人挑戰 - 1-2
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
status = 'failed'; // 全域變數 | |
function getStatus() { | |
status = 'ok'; // 區域變數 | |
return status | |
} | |
console.log(getStatus()) // 印出 ok | |
console.log(status) // 預期要印出 failed,結果卻印出 ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment