Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のような宣言がある場合:
var j;
私がj==nullそれを何かに等しく設定するまではどうしますか?
j==null
いいえ、デフォルト値はですが、条件undefined を使用する場合は!j、両方の値(つまり、未定義またはnull)で機能します。
undefined
!j
JavaScriptには「偽の」値があり、値を変換するための予期しないルールがあり、値と型を同時に比較するための派手な演算子があり(j==null)ます。true(j===null)false===
(j==null)
true
(j===null)
false
===