# JavaScript * getComputedStyle(element) 取得element的CSS * getPropertyValue(property) 取得element的CSS的屬性 **Example:** ``` getconst range_width = getComputedStyle(e.target).getPropertyValue('width') ``` --- * **null**:變數存在,指派null值 * **undefined**:變數存在,未指派值 * **undeclared**:變數不存在 --- * **立即函式(IIFE-Immediately Invoked Function Expression)** 立即函式是Javascript中可以立即執行的函式 很常被用來執行只用一次的程式碼,例如初始化動作 ``` (function(){ // my special code })(); ``` ``` var hello = function(name){ console.log('Hello ' + name); }('Simon'); ---Hello Simon ``` ``` (function(food){ console.log('大俠愛吃' + food) }('漢堡包')); ``` [**來源**](https://ithelp.ithome.com.tw/articles/10193313) --- * **closure(閉包)** 閉包就是當在函式裡,函式的作用域(scope)和經由此函式宣告而可存取的變數,將仍是可被內部的函式所存取。 ``` function init() { var name = "Mozilla"; function displayName() { alert(name); } displayName(); } init(); ``` [**關於閉包**](https://nissentech.org/why-do-we-need-closure/) ---