2017-11-06T14:23:09Z||2017-11-06T14:23:09Z


代码:

const obj = {
  a: 1,
  b: 2,
  c: 1,
};

console.log(Object.keys(obj));
console.log(Object.values(obj));
console.log(Object.entries(obj));

输出:

[ 'a', 'b', 'c' ]
[ 1, 2, 1 ]
[ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 1 ] ]