【學(xué)習(xí)打卡】第6天 ES(6-11)全版本語法-對象擴(kuò)展:Object.values(),Object.entries()
標(biāo)簽:
JavaScript
-
课程名称:JavaScript ES(6-11)全版本语法 每个前端都需要的基础课
-
课程章节: 对象属性描述:Object.getOwnPropertyDescriptors()
-
主讲老师:谢成
课程内容:
今天学习的内容包括:
对象属性描述:Object.getOwnPropertyDescriptors(),
课程收获:
Object.getOwnPropertyDescriptors() 所指定对象的所有自身属性的描述符,如果没有任何自身属性,则返回空对象。
const obj = {
name: 'imooc',
course: 'es'
}
const desc = Object.getOwnPropertyDescriptors(obj)
console.log(desc)
const obj = {}
Reflect.defineProperty(obj, 'name', {
value: 'xiecheng',
writable: true,
configurable: true,
enumerable: false
})
Reflect.defineProperty(obj, 'age', {
value: 34,
writable: true,
configurable: true,
enumerable: true
})
console.log(obj)
obj.name = 'zhangsan'
console.log(obj)
delete obj.name
console.log(obj)
for(let key in obj){
console.log(key)
}
console.log(Object.getOwnPropertyDescriptors(obj))
console.log(Object.getOwnPropertyDescriptor(obj, 'age'))
今天学习课程共用了35分钟,重新了解了一下Object.getOwnPropertyDescriptors(),这是我不知道第多少次决心补习JavaScript基础,希望能够坚持下去。
點(diǎn)擊查看更多內(nèi)容
為 TA 點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦