当前位置: 代码迷 >> 综合 >> es 基础
  详细解决方案

es 基础

热度:82   发布时间:2024-01-24 14:20:49.0

es 函数 

  • 箭头函数  Inputs=>outputs  箭头函数
  • 成员函数
  • 声明函数
  • 函数表达式
  • 默认传参

es class
class,extends super 在JavaScript中一直是保留字

包装器对象扩展

 

  • 对象字面量-Object  扩展  Object.keys() Object.values() Object.entries()  Object.assign()
  • 对象字面量-String  扩展
  • 对象字面量-Number  扩展
  • 对象字面量-Boolean  扩展

es  数据结构优化 

  • 在数据结构中优先考虑Map、Set,放弃数组和Object 


模板字符串
展开符

//数组的map用法
arr.map((v)=>{console.log(v)})//数组去重
let arr=[1,2,3,3];
arr =[...new Set(arr)]//数组连接
arr = [...arr,...[5,6]];


for of 循环


变量声明

  • const   let   var 声明变量

 

模块化

  • export default{}
  • import  from

 

  相关解决方案