当前位置:网站首页>解构的运用
解构的运用
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边栏推荐
猜你喜欢

ARM体系结构概述

typescript6 - simplify the steps to run ts

MySql详解基础

【day5】数组

Mybitatis related configuration files

typescript6-简化运行ts的步骤

IDEA search plug-in has no results and the solution has been spinning in circles

Limit injection record of mysql injection in No. 5 dark area shooting range

typescript1-typescript是什么

Map file analysis in Keil software
随机推荐
C语言自定义类型详解
39.【vector动态数组定义及初始化】
Mybitatis相关配置文件
风险登记册
AutoSAR EcuM系列02- Fixed EcuM的状态管理
LSF提交作业命令--bsub
How to calculate the daily cumulative capital flow one by one in real time
go : delete database data using grom
go : go-redis set operations
SQL窗口函数
Architectural Design Guide How to Become an Architect
2022年施工企业数字化转型思考,施工企业数字化转型之路
typescript1-typescript是什么
2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
MySQL basics [naming convention]
docker部署redis一主二从三哨兵模式
golang grpc protoc 环境配置
LeetCode:647. 回文子串
OA项目之待开会议&历史会议&所有会议
实现定时器