当前位置:网站首页>59-[key]object Get method of defineproperty
59-[key]object Get method of defineproperty
2022-07-20 08:41:00 【longfei815】
59-[ a key ]Object.defineProperty Of get Method
// When to execute ?
// obtain name Property, execute the code here
// obj.name What is the value of ?? Namely return The following value
<!DOCTYPE html>
<html lang="en">
<head>
<title>59-[ a key ]Object.defineProperty Of get Method </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link href="css/style.css" rel="stylesheet"> -->
<script>
let obj = {};
Object.defineProperty(obj,'name',{
get(){
// When to execute ?
// obtain name Property, execute the code here
console.log(' Yes get');
// obj.name What is the value of ?? Namely return The following value
return 'Vue'
}
});
// console.log(obj);
console.log(obj.name);
</script>
</head>
<body>
</body>
</html>
边栏推荐
- 100-京东导航栏-插槽使用-弹性布局(display: flex;)
- 66-[重点]v-for指令的key属性
- 数组的 reduce方法
- 54-Object.defineProperty方法
- Pointer in C language (learning experience)
- 【js】浅拷贝与深拷贝
- 【学习笔记】Solid Works 作业记录
- C language structure type
- Space saving "bit segments" in C language“
- Part 59: main c:62:9: note: use option -std=c99 or -std=gnu99 to compile your code
猜你喜欢
Interesting minesweeping game, C language programming
页面搜索高亮功能,页面自动匹配关键字滚动到屏幕正中间,并高亮显示。
JS如何判断当前日期是否在某个范围内
递归回溯—走迷宫
通过调试发现程序死循环的原因
Representation and operation of data
Process to thread and incoming thread communication
Pointer operation exercises and string functions
Heap sorting and heap related operations
数据在内存中存储是怎样的?
随机推荐
学生成绩管理系统(c语言)
编写一个select下拉列表
Shell Scripting
Character functions and string functions
如何解决跨域问题
js同步与异步问题
Interesting minesweeping game, C language programming
Pytorch target detection data enhances the mixing of cutmix and mixup
使用nvm use出现exit status 1与exit status 145乱码
c语言自定义类型:结构体、枚举、联合
shell脚本编程
3.数据绑定
Study diary 1
Easier to use C language entry-level cheese (1) data types, variables and constants, strings + escape characters + comments (super detailed)
ES6之Object.defineProperty 和 Proxy 区别
补充:ES6知识点
【js】call()、apply()、bind() 的用法
C语言实现基础版扫雷
14.过滤器的使用
学习日记6-数组