当前位置:网站首页>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
边栏推荐
- 我愿称之为史上最全的深度学习面经总结(附答案详解)
- 工业机械臂(机器人)视觉定位引导系统
- JUnit test suite method sorting (method 2 is not easy to use)
- Two months' experience in C language
- [lambda operation jcf]
- C main函数
- Yiwei lithium energy plans to raise 9billion yuan: liujincheng and luojinhong jointly subscribe for 6billion yuan of layout Optical Valley
- Xshell (I) is missing mfc110u DLL file resolution
- Mobileone: the mobile terminal only needs 1ms of high-performance backbone. You deserve it!
- Energy chain smart electronics landed on NASDAQ: Bain is the shareholder to become the first share of charging services in China
猜你喜欢

SQL cross database injection

selenium-webdriver之断言

C 字符串

Huawei equipment configuration BGP as number replacement

Appnium (II) installation and basic use of mitmproxy

数据的收集

JUnit test suite method sorting (method 2 is not easy to use)

工业机械臂(机器人)视觉定位引导系统

Introduction to QT reflection mechanism and signal slot mechanism

阿里建议所有 POJO 类属性使用包装类,但这些坑你有注意到吗?
随机推荐
New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!
Mobileone: the mobile terminal only needs 1ms of high-performance backbone. You deserve it!
Autofac初学(1)
Configuring OSPF pseudo connection for Huawei devices
PHPstudy建站提示hosts文件可能不存在或被阻止打开,同步hosts失败怎么解决
【LocalDate LocalTime LocalDateTime】1. Using immutability to achieve thread safety 2 Current date, current time, current date time 3 Since the time zone is not considered, you need to add 8 hours to th
[ROC] aspriseocr C # English, Digital identification (not Chinese)
我愿称之为史上最全的深度学习面经总结(附答案详解)
Xshell (I) is missing mfc110u DLL file resolution
Junit测试中常用的断言
ADSL
C secret script Chapter 1: data storage (in-depth analysis)
Interview (XI) futu written test questions
MySQL index and view
[SPARK][CORE] 面试问题之谈一谈Push-based shuffle
Use Baidu AIP to obtain the text in the specified area of the screen
野指针理解
函数递归示例
C secret arts script Chapter 5 (paragraph) (Section 3)
宝塔面板新建数据库提示数据库名不能大于16位的解决方法