当前位置:网站首页>New features of ES6
New features of ES6
2022-06-12 14:50:00 【luemeon】
Arrow function
Equivalent to anonymous function
- The arrow function itself has no scope ( nothing this)
- Arrowhead function this Point up one level , Context determines its this
- Basic grammar : Parameters => The body of the function
- Arrow in function body this object , Is the object when the function is defined , Instead of the object when using the function . It was decided when the function was defined
() => return 'hello'
(a, b) => a + b
(a) => {
a = a + 1
return a
}`${}`
Back single quotes (``) Complete the stitching character string Not single quotes (‘’)
let str=`I love ${a}, because he is handsome.`;let:ES6 newly added , Used to declare variables , Yes Block level scope
let [a, b, c] = [1, 2, 3];
// a = 1,b = 2,c = 3 It is equivalent to redefining variables a,b,c, The value is also more convenient
// , = Place holder
let arr = [" Xiao Ming ", " floret ", " Little fish ", " Piglets "];
let [,,one] = arr; // Small fish will be taken here
// Deconstruct the entire array
let strArr = [...arr];
// Get the entire array
console.log(strArr);
- Deconstructing assignment is an extension of assignment operator
- Pattern matching for arrays or objects , And then assign values to the variables
- all 2021 Years. , No more learning ES6 You just out 了 —— Article, understand ES6_ Ouyang Ya's blog -CSDN Blog
边栏推荐
- Two months' experience in C language
- junit测试套件方法整理(方法二不太好用)
- NETCORE combined with cap event bus to realize distributed transaction -- Introduction (1)
- selenium之元素定位
- Yiwei lithium energy plans to raise 9billion yuan: liujincheng and luojinhong jointly subscribe for 6billion yuan of layout Optical Valley
- [SPARK][CORE] 面试问题之谈一谈Push-based shuffle
- Location (I) error: command erred out with exit status
- Dataset and dataframe in sparksql
- Two methods of QT using threads
- 【Instant】1. Equivalent to date class 2 Represents a moment
猜你喜欢

Yiwei lithium energy plans to raise 9billion yuan: liujincheng and luojinhong jointly subscribe for 6billion yuan of layout Optical Valley

我愿称之为史上最全的深度学习面经总结(附答案详解)

你敢信?開發一個管理系統我只用了兩天

Ali suggests that all POJO attributes use wrapper classes, but have you noticed these pits?

MAT的安装和使用

Introduction to QT reflection mechanism and signal slot mechanism

基于TensorRT的深度学习模型部署实战教程!

Visual positioning guidance system for industrial manipulator (robot)

Element positioning of selenium

Two methods of QT using threads
随机推荐
Raspberry pie get temperature and send pictures to email
函数递归示例
Mysql之索引和视图
recursive learning
Selenium advanced
Installation and use of mat
selenium之元素定位
Soft test (VI) Chrome browser installation selenium IDE
Basic usage of scanner
C secret arts script Chapter 2 (detailed explanation of pointers) (Section 3)
【Optional】1. Map and ifpresent 2 Ofnullable and orelse
Ali suggests that all POJO attributes use wrapper classes, but have you noticed these pits?
[lambda operation jcf]
基于TensorRT的深度学习模型部署实战教程!
C scanf函数
程序构造和解释之第一章习题
JD scanning code to obtain cookies
Jetpack architecture component learning (3) -- activity results API usage
NetCore结合CAP事件总线实现分布式事务——入门(1)
Energy chain smart electronics landed on NASDAQ: Bain is the shareholder to become the first share of charging services in China