2012-01-01から1ヶ月間の記事一覧

スコープのお勉強

おさえたいのはこの一文。 Function declarations and variable declarations are always moved ("hoisted") invisibly to the top of their containing scope by the JavaScript interpreter. JavaScript Scoping and Hoistingそのホームはhttp://www.adequ…

オブジェクトの型を調べる

例えば var a = "moji"; (typeof a) は "string"と出力される。じゃあ、 var a = new Date(); (typeof a) は "object"と出力される。ざっくり"object"といってきます。 そこで、クラスの型を調べたければ、(a.constructor.toString())が使えます。関連:inst…