获取对象key值与key[value值]
var obj = { 'name': '杨', 'year': 27 } var key = [] var value = [] for (var i in obj) { key.push(i) value.push(obj[i]) } console.log(key) console.log(value)