![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6
fjdkk
这个作者很懒,什么都没留下…
展开
-
ES箭头函数
箭头函数认识箭头函数箭头函数结构:const/let 函数名 = (参数)=> { 函数体 }将普通函数改写为箭头函数const add=function(x,y){};const add=(x,y)=>{};注意事项单个参数:可以省略圆括号,无参或多个参数不能省略:const add = x =>{}单行函数体:可以同时省略{}和return,多行函数体不能再简化:const add = (x,y)=>x+y单行对象:返回单行对象,原创 2021-11-09 13:23:33 · 1727 阅读 · 0 评论 -
ES--模板字符串
模板字符串认识模板字符串用反引号包裹和其他东西一起使用时,使用模板字符串方便注入const person = { username: 'Alex', age: 18, sex: 'male'};// 一般字符串const info='名字'+person.username+'年龄'+person.age;//模板字符串const info_mb=`名字${person.username} 年龄${person.age}`;console.log(info);cons原创 2021-11-09 12:50:34 · 2082 阅读 · 0 评论