当前位置:网站首页>How to delete an attribute or method of an object
How to delete an attribute or method of an object
2022-07-03 13:58:00 【Little meow, meow】
send ⽤ delete keyword , You can delete the attributes of an object or ⽅ Law .
var obj = {
};
obj.name; // undefined;
obj.name = "Lilei";
obj.name; // "Lilei"
obj.sayHello = function () {
console.log("hello") };
obj.sayHello(); // "Hello";
delete obj.name; // true
delete obj.sayHello; // true;
obj.name; // undefined;
obj.sayHello(); // Error: undefined
It can be seen from the above that , send ⽤delete You can delete the attributes of an object or ⽅ Law , If the deletion is successful, it will return true, For non-existent attributes ⾏ lead ⽤ Will return to undefined, Yes, it doesn't exist ⽅ Fajin ⾏
transfer ⽤ When an error .
边栏推荐
- Depth and breadth first traversal of tree (regardless of binary tree)
- Dlopen() implements dynamic loading of third-party libraries
- php 迷宫游戏
- 太阳底下无新事,元宇宙能否更上层楼?
- 金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
- 金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
- 使用vscode查看Hex或UTF-8编码
- 消息订阅与发布
- Error running 'application' in idea running: the solution of command line is too long
- Golang — 命令行工具cobra
猜你喜欢

Rasp implementation of PHP

RichView TRVStyle ListStyle 列表样式(项目符号编号)

Mastering the cypress command line options is the basis for truly mastering cypress

Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases

GoLand 2021.2 configure go (go1.17.6)
![[机缘参悟-37]:人感官系统的结构决定了人类是以自我为中心](/img/06/b71b505c7072d540955fda6da1dc1b.jpg)
[机缘参悟-37]:人感官系统的结构决定了人类是以自我为中心

【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明
![[技术发展-24]:现有物联网通信技术特点](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[技术发展-24]:现有物联网通信技术特点

Use and design of Muduo buffer class
![[technology development-24]: characteristics of existing IOT communication technology](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[technology development-24]: characteristics of existing IOT communication technology
随机推荐
JVM系列——概述,程序计数器day1-1
Rasp implementation of PHP
page owner特性浅析
[développement technologique - 24]: caractéristiques des technologies de communication Internet des objets existantes
selenium 浏览器(1)
GoLand 2021.1: rename the go project
Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
mysql中的字段问题
[acnoi2022] guess numbers
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
SQL Injection (AJAX/JSON/jQuery)
The latest BSC can pay dividends. Any B usdt Shib eth dividend destruction marketing can
Unable to stop it, domestic chips have made another breakthrough, and some links have reached 4nm
【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明
[ACNOI2022]猜数
Qt学习25 布局管理器(四)
Shell timing script, starting from 0, CSV format data is regularly imported into PostgreSQL database shell script example
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线