Javascript-var hoisting

--

在聽Vue教學影片時聊var let const時,再談到var hoising問題。

查了一下相關資料

alex說被問到 var let 有什麼差別?
最白話的回答
var : old school
let : fashion
哈,var 是當你很在意舊有的瀏覽器,不然都直接用let就對了XD

目前對var let 的明顯差別在,
var : 全域變數,可以先用,事後再宣告
let : 區域變數,

--

--

Jameskrauser Lee
Jameskrauser Lee

Written by Jameskrauser Lee

For the last few years. i was involved mostly in the development of Automatic Fare collection system for the Chennai Metro. Familiar with C++ and iOS.

No responses yet