object.keys()返回的是数组的下标值或者对象的属性名。
举例:
const compareList = {sale: "1",goodsNum: "2",roomNum: "3"
}
const obj=[1,2,3]console.log(Object.keys(compareList));
console.log(Object.keys(obj));
最后打印出来的结果:
object.keys()返回的是数组的下标值或者对象的属性名。
举例:
const compareList = {sale: "1",goodsNum: "2",roomNum: "3"
}
const obj=[1,2,3]console.log(Object.keys(compareList));
console.log(Object.keys(obj));
最后打印出来的结果: