1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| let str='1234' onsole.log(Object.keys(str));
let obj={ name:'xiaoming', age:18 } console.log(Object.keys(obj));
let arr=[1,2,3,4,5] console.log(Object.keys(arr));
function Basic(name,age,address){ this.name = name; this.age = age; this.address = address; this.info = function(){ return (this.name + '/' + this.age + '/' + this.address); } }; console.log(Object.keys(Basic)); var lily = new Basic('li',18,'fujian'); console.log(Object.keys(lily));
let person = {name:"张三",age:25,address:"深圳",getName:function(){}} Object.keys(person).map((key)=>{ person[key]
})
|