当前位置:网站首页>Object. getOwnPropertyNames() VS Object.keys()
Object. getOwnPropertyNames() VS Object.keys()
2022-07-26 21:27:00 【Ziwei front end】
differences
Object.getOwnPropertyNames(obj)Returns all properties of the objectobj.Object.keys(obj)Back to all enumerable Properties of .Unless you setenumerable: falseFor any attribute , Otherwise they will provide the same results .In the following example , ThescreenObject has two properties ,branchalsosize.
const screen = {
branch: 'Dell',
size: '27inch',
};
Object.getOwnPropertyNames(screen); // ['branch', 'size']
Object.keys(screen); // ['branch', 'size'] Let's define another attribute named resolution, But it is set to enumerable: false:
Object.defineProperties(screen, {
resolution: {
enumerable: false,
v边栏推荐
- 【MySQL系列】-索引知多少
- Object.getOwnPropertyNames() VS Object.keys()
- MySQL -count: the difference between count (1), count (*), and count (column name)
- 调整表格列的大小
- How to enter the specified user method body when debugging in idea?
- 【HarmonyOS议题资料下载】HDD杭州站·线下沙龙专注应用创新 展现鸿蒙生态魅力
- encodeURI VS encodeURIComponent
- 串口通信失败
- 留存收益率计算公式
- Monitor MySQL based on MySQL exporter
猜你喜欢

一种用于实体关系抽取的统一标签空间

Flash source code outline

牛客刷题——Mysql系列

js中join方法

Detailed illustration of B-tree and its implementation in C language
![[virtual machine data recovery] data recovery of XenServer virtual machine unavailable due to unexpected power failure](/img/c4/88f8927df02513eea4caffc4215850.png)
[virtual machine data recovery] data recovery of XenServer virtual machine unavailable due to unexpected power failure

golang版本管理gvm

How to enter the specified user method body when debugging in idea?

How to use multiple languages in a project?

Daily practice ----- there is a group of students' grades. Arrange them in descending order. To add a student's grade, insert it into the grade sequence and keep the descending order
随机推荐
APaaS低代码平台(一) | 把复杂留给自己,把简单留给用户
Smooth scroll to element
ROS2节点通信实现零拷贝
Live broadcast appointment award | senior consultant xuyanfei: how does efficiency measurement help efficient and sophisticated outsourcing management
[HCIA security] NAT network address translation
Rare discounts on Apple's official website, with a discount of 600 yuan for all iphone13 series; Chess robot injured the fingers of chess playing children; Domestic go language lovers launch a new pro
Daily practice ----- there is a group of students' grades. Arrange them in descending order. To add a student's grade, insert it into the grade sequence and keep the descending order
Apaas low code platform (I) | leave complexity to yourself and simplicity to users
Error in render: “TypeError: data.slice is not a function“
如何借助自动化工具落地DevOps|含低代码与DevOps应用实践
修改excel默认编码
[download materials of harmoniyos topics] HDD Hangzhou station · offline salon focuses on application innovation to show the ecological charm of Hongmeng
Serial port communication failure
Deepfake pinches his face. It's hard to tell whether it's true or false. Tom Cruise is more like himself than himself!
DeepFake捏脸真假难辨,汤姆·克鲁斯比本人还像本人!
LeetCode 练习——剑指 Offer II 005. 单词长度的最大乘积
Detailed illustration of B-tree and its implementation in C language
服务器的防护会遇到什么样的安全问题呢?
自定义注解(一)
Ros2 method of obtaining current system time