ES6 基础
2018-02-27 本文已影响0人
Rioo丶
1. 对象
const obj = {
id: 001,
name: 002
};
console.log(Object.keys(obj)); // ['id','name']
console.log(Object.values(obj)); // ['001','002']
console.log(Object.entries(obj)); // [['id','001'],['name','002']]
const obj = {
id: 001,
name: 002
};
console.log(Object.keys(obj)); // ['id','name']
console.log(Object.values(obj)); // ['001','002']
console.log(Object.entries(obj)); // [['id','001'],['name','002']]