Object.keys
:获取对象的键名列表
Object.values
:获取对象的键值列表
<script>
var obj = {
name: 1,
age: 2,
order: 3
}
const klist = Object.keys(obj)
const vals = Object.values(obj)
console.log('obj', obj)
console.log('键名列表', klist)
console.log('键值列表', vals)
</script>