记住用户名密码
对象长度
var bookAuthors = { "Farmer Giles of Ham": "J.R.R. Tolkien", "Out of the Silent Planet": "C.S. Lewis", "The Place of the Lion": "Charles Williams", "Poetic Diction": "Owen Barfield" }; // 获取对象的key值 var arr = Object.keys(bookAuthors); console.log(arr); // 获取长度 console.log(arr.length);
数据长度
var arr = ["zuojj", "benjamin", "www.zuojj.com"]; //Outputs: ["0", "1", "2"] console.log(Object.keys(arr)); //Outputs: 3 console.log(arr.length);
目前有 0 条留言 其中:访客:0 条, 博主:0 条