setTimeout 與 setInterval 中的 this 不管當前使用的this指向誰,在使用 setTimeout 或者 setInterval 中的 this 都會指向最外層對象,也就是window ,而使用箭頭函數就可以讓 this 繼續指向上一層對象而不是最外層。 body buttn id='demo'發送驗證碼/button /body script type="t