摘要:
私有属性 class Person{ //公有属性 name; //私有属性 #age; #weight; //构造方法 constructor(name, age, weight){ this.name = name; this.#age = age; this.#weight = weight; 阅读全文
摘要:
Object.fromEntries //二维数组 const result = Object.fromEntries([ ['name','Study'], ['xueke', 'Java,大数据,前端,云计算'] ]); //Map const m = new Map(); m.set('nam 阅读全文
摘要:
扩展运算符与rest参数 <!-- Rest 参数与 spread 扩展运算符在 ES6 中已经引入,不过 ES6 中只针对于数组, 在 ES9 中为对象提供了像数组一样的 rest 参数和扩展运算符 --> //rest 参数 function connect({host, port, ...us 阅读全文
摘要:
async 和 await async 和 await 两种语法结合可以让异步代码像同步代码一样 async 函数 async 函数的返回值为 promise 对象 promise 对象的结果由 async 函数执行的返回值决定 //async 函数 async function fn(){ // 阅读全文