iT邦幫忙

2021 iThome 鐵人賽

DAY 5
0
Modern Web

YDKJS 一邊讀 You Don't Know JS Yet 一邊卡關一邊弄懂的日子 ԅ(≖‿≖ԅ)系列 第 5

Day05 - this&Object Prototypes Ch3 Objects - Contents - Property Descriptors 開頭

我們已經知道 Object.getOwnPropertyDescriptor() 可以取得特定屬性的詳細資訊,而這些屬性我們是可以透過 Object.defineProperty 自己定義的

var a = {}
Object.defineProperty(a, "food", {
    value: "Chocolate",
    writable: true,
    configurable: true,
    enumerable: true
})

Object.getOwnPropertyDescriptor(a,"food")

今天只看一點點,如果理解有誤希望能多多提點,謝謝大家 ԅ(≖‿≖ԅ)


上一篇
Day04 - this&Object Prototypes Ch3 Objects - Contents - Property Descriptors 開頭
下一篇
Day06 - this&Object Prototypes Ch3 Objects - Contents - Property Descriptors
系列文
YDKJS 一邊讀 You Don't Know JS Yet 一邊卡關一邊弄懂的日子 ԅ(≖‿≖ԅ)30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言