undefined

undefined (JavaScript)

型変換

真偽値

[7] undefinedの値とみなされます。

代替

[6]undefined は古い版の JavaScript では用意されていませんでした (概念としては存在しました)。 そのため、未定義値であるかの判定には void(0) (引数は任意の値です。) と比較したり、 typeof() の返す値が "undefined" と等しいか比較したりする方法が採られていました。 その名残で最近であってもこれらの方法が使われることがあります。 ()

関連

[8] undefinednull と似ていますが、別の値です。

[9] 意味的・機能的・名前的に Perlundef と似ています。ただし PerlundefJavaScriptnull の役割も担います。

[10] undefined空文字列false とも別の値です。

歴史

[4]

The undefined value is a primitive value used when a variable has not been assigned a value.

[5]

The type Undefined has exactly one value, called undefined.

[2] >>1 は消滅、 Internet Archive にもなし。 (名無しさん 2005-03-29 11:51:57 +00:00)

[3] >>2 JavaScript の未定義値 undefined を考える <http://web.archive.org/web/20040511124940/http://kobit.info/tips/undefined.html> (名無しさん 2005-04-24 09:18:56 +00:00)

[11] Define hack for open() to deal with undefined and omitted being differen... · 76a4c65 · whatwg/xhr ( ( 版)) <https://github.com/whatwg/xhr/commit/76a4c653ffd0a65e04a52fe2daa9729dbcf64410>

[12] Write structured clone algorithm in terms of ECMAScript · whatwg/html@bfb960c ( 版) <https://github.com/whatwg/html/commit/bfb960c938580c95e77365e614218b952f96375b>

[13] Breaking: refactor structured clone into serialize/deserialize (domenic著, ) <https://github.com/whatwg/html/commit/97d644c97335956610a31e8ad98d1a388c063e84>