Top > Misc > Test Object Object & Array Object

Test Object Object & Array Object

Object Object

var t1 = {
    foo : "bar",
    hoge : "fuga",
}
document.write(t1["foo"]);

Result

On Opera Browser, it's syntax error. On Firefox or Konqueror, it's OK.

Array Object

var t2 = ["foo", "bar", "baz", ];
document.write(t2[2] + ", array length:"+ t2.length);

Result