当前位置:网站首页>解构的运用
解构的运用
2022-07-30 07:08:00 【逝去的不再来】
let { bar, foo } = { foo: ‘aaa‘, bar: ‘bbb‘ };
foo // "aaa"
bar // "bbb"
let { ba } = { foo: ‘aaa‘, bar: ‘bbb‘ };
ba // undefinedlet { foo: ba } = { foo: ‘aaa‘, bar: ‘bbb‘ };
ba // "aaa"
foo // error: foo is not definedvar {x = 3} = {};
x // 3
var {x, y = 5} = {x: 1};
x // 1
y // 5
var {x: y = 3} = {};
y // 3
var {x: y = 3} = {x: 5};
y // 5
var { message: msg = ‘Something went wrong‘ } = {};
msg // "Something went wrong"
var {x = 3} = {x: undefined};
x // 3
var {x = 3} = {x: null};
x // nulllet arr = [1, 2, 3];
let {0 : first, [arr.length - 1] : last} = arr;
first // 1
last // 3边栏推荐
猜你喜欢

Keil软件中map文件解析

实现定时器

Interview with Ant: How do these technology pioneers do the bottom-level development well?| Excellent technical team interview

谷粒商城--环境部署(2022/7/28最新)

41.【vector应用操作2】

你好,我的新名字叫 “铜锁 / Tongsuo”

MagicDraw二次开发过程

Architectural Design Guide How to Become an Architect

typescript4-安装编译ts的工具包

Mybitatis related configuration files
随机推荐
k8s 部署mysql8(PV和PVC 版本)
sizeof
数据库连接池的使用
【Codeforces Round #805 (Div. 3)(A~C)】
tabindex attribute of input tag & tabindex attribute of a tag
AutoSAR EcuM系列02- Fixed EcuM的状态管理
IDEA 中CheckStyle安装及使用
A magical no main method of code
物联网网关该怎么选
Map file analysis in Keil software
selenium模块
input标签的tabindex属性 & a标签的tabindex属性
出网判断:
架构设计指南 如何成为架构师
ArrayList
39.【vector动态数组定义及初始化】
File类
MySql Detailed Basics
Hex conversion...
typescript6 - simplify the steps to run ts