Day12 - this&Object Prototypes Ch3 Objects - Contents - Existence - Enumeration

将 enumerable 设为 false 的 property,在回圈时无法被 in operator 发现

var myObject = { }; 
Object.defineProperty(
	myObject,"food",
  { enumerable: true, value: '燃面' }
);

Object.defineProperty(
	myObject,"dessert",
  { enumerable: false, value: '大蛋糕' }
);

console.log("dessert" in myObject); // true
console.log(myObject.hasOwnProperty( "dessert" )); // true

for (item in myObject) {
	console.log( item );
} // 却只有 'food'

今天记到这边,大家晚安,如果以上内容有理解错误的地方都希望能再协助纠正,感恩的心 ԅ(≖‿≖ԅ)


<<:  12 - Metrics - 观察系统的健康指标 (6/6) - 使用 Metricbeat 掌握 Infrastructure 的健康状态 AWS 篇

>>:  【D13】发现新book:Account Data- Position

资安学习路上-网站常见漏洞与 Injection的爱恨情仇2

SQL injection 先来简单练习 https://www.hacksplaining.com...

Day02【JS】Event Delegation 事件委派

所谓的 Event Delegation, 即是藉由事件传递减少监听器数目的一种方法。 事件传递 事...

Day26 - 【概念篇】Keycloak使用基本概念 - 第二部分: User & Group

本系列文之後也会置於个人网站 帐号(User) 基本讯息 接着来看看与帐号有关的设定。 在之前,已...

[ Day 22 ] React 中的 State 管理 - Redux

今天进入到全新的篇章 Redux 了! Redux 是 React.js 中很常拿来作为状态管理使...

DAY9 Linebot 自动回应-2

先检查一下你的专案结构是不是大概长成这样,有一些是後来才新增的功能。 假设原本我们安装的ngrok放...