JavaScript重點整理
Last updated
Last updated
function除了直接呼叫外, 同時也可以是物件的類constructer function, this
的觀念, 及使用bind
來改變this指向的object. 是其它語言比較沒有的.
當直接呼叫function時(沒有使用.
or new
or ={}
or bind/call/apply
時),this
是指到global物件.
可使用object literal notion, {}
來當做基本類型JavaScript Object
的定義. 若{}沒有包含function, 就變成一般的JSON資料了.
global scope對應到一個global object.
function內部包含其他function宣告(nested function), 其他語言可能有類似但沒有這麼直接.
object可runtime執行時輕易動態擴充member (ES5 way)
多了 ===
這個operator
沒有private
關鍵字
JavaScript沒有C
type的pointer跟C#/Java
其reference的id.
Prototype的概念.
string
為immutable primitve value type, 非物件類別.