var pageList = {
name1: 'aa'
name2: 'bb'
name3: 'cc'
}
console.log(Object.getOwnPropertyNames(ageList).length) //3
let result =JSON.stringify(pageList)
console.log(this.result)
{
'name1','aa',
'name2','bb',
'name3','cc'
}
let result =JSON.parse(JSON.stringify(pageList))
console.log(this.result)
{
name1: 'aa'
name2: 'bb'
name3: 'cc'
}
获取对象的key值
console.log(Object.keys(ageList)) //[name1,name2,name3]
获取对象的values值
console.log(Object.values(ageList)) // [aa,bb,cc]