StackOverflow 文档 JavaScript 教程 对象 Object.keys Object.keys Created: November-22, 2018 Version >= 5 Object.keys(obj) 返回给定对象键的数组。 var obj = { a: "hello", b: "this is", c: "javascript!" }; var keys = Object.keys(obj); console.log(keys); // ["a", "b", "c"] 只读属性将对象值转换为数组