2009年2月6日金曜日

JavaScriptで変数(オブジェクト)が配列かどうかを知る方法

foo = [1];
if (foo instanceof Array) {
alert (true);
} else {
alert (false);
}

0 件のコメント: