一個類數(shù)組對象乍构,如果有splice方法筐付,在Chrome控制臺將以數(shù)組方式顯示迟赃。
> var a={0:'a',length:1};
undefined
> a
Object {0: "a", length: 1}
> a.splice=[].splice;
function splice() { [native code] }
> a
["a"]
一個類數(shù)組對象乍构,如果有splice方法筐付,在Chrome控制臺將以數(shù)組方式顯示迟赃。
> var a={0:'a',length:1};
undefined
> a
Object {0: "a", length: 1}
> a.splice=[].splice;
function splice() { [native code] }
> a
["a"]