Object.keys
时间: 2023-10-12 19:00:45 浏览: 88
Object.keys是一个用于返回给定对象的所有可枚举属性的字符串数组的方法。这个方法的语法是Object.keys(obj),其中obj是要返回其可枚举属性的对象。例如,如果有一个名为person的对象,它有属性name、age、address和getName,那么Object.keys(person)将返回一个数组["name", "age", "address", "getName"],这个数组包含了person对象的所有可枚举属性的名称。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Object.keys()、Object.values()、Object.entries()的用法](https://blog.csdn.net/weixin_43675447/article/details/99232258)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Object.keys使用整理](https://blog.csdn.net/weixin_30897079/article/details/101580481)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文