delete 用法总结
2024-08-31 16:18:03
// delete 删除
// 语法: boolean delete 数据;
// 在当前作用域上删除数据
// 用法:
// 1, 删除数组中的一个元素
// 2, 删除一个对象的属性或方法
// 3, 删除一个没有用 var 声明 变量
/*
var arr = [ 1, 2, 3, 4 ];
console.log( arr );
console.log( arr.length )
var isTrue = delete arr[ 2 ];
console.log( arr );
console.log( arr.length )
*/
/*
var o = { name: "jim" };
var isTrue = delete o.name; // o[ "name" ]
*/
var n = 1;
m = 2;
var isTrue1 = delete n;
var isTrue2 = delete m;
console.log( isTrue1 ); // => false
console.log( isTrue2 ); // => true
console.log( n ); // => 1
console.log( m ); // => undefined
最新文章
- 线程安全的无锁RingBuffer的实现
- 用JS控制video暂停再播放
- 常用JS效果 需要时更新。。。
- object.assign()方法的使用
- iOS - (调用系统本机发送短信功能)
- Android Handler之Message传递参数
- Controller里写自己需要的Action,参数的名字必须和路由设置的参数名一致
- 正则表达式匹配(node.js)
- 数据(数组,json)的处理
- SQL VS NoSQL
- 2019-04-29 EasyWeb下配置Atomikos+SQLServer分布式数据源
- Lesson 2-2(列表,元组)
- Springboot 2.返回cookies信息的get接口开发 和 带cookis去请求
- hadoop1.2开发环境搭建
- jmeter下TPS插件的安装
- python3 线程池-threadpool模块与concurrent.futures模块
- JVM异常之:堆溢出OutofMemoryError
- mpvue使用scroll-view实现图片横向滑动
- [Python] numpy.nonzero
- [LearnOpenGL]照相机的变换、坐标系、摄像机
热门文章
- CF1000G Two-Paths (树形DP)
- malloc 和free例程
- win系统安装node出现这个2503和2502解决办法
- servlet3.0 @webfilter 过滤顺序
- Qt之QTemporaryFile
- 新手做2D手游该用哪些工具?
- iOS开发- Images can’t contain alpha channels or transparencies 解决的方法
- Java - 多线程Callable、Executors、Future
- bzoj1800: [Ahoi2009]fly 飞行棋(乱搞)
- PostgreSQL Replication之第六章 监控您的设置(3)