摘要:
class Person { // 公有属性 name; // 私有属性 #age; #weight; // 构造方法 constructor(name,age,weight){ this.name = name; this.#age = age; this.#weight = weight; } 阅读全文
摘要:
// flat 将多维数组转为地位数组 const arr = [1,2,3,4,[5,6]]; console.log(arr); //[1,2,3,4,5,6] cosnt arr1 = [1,2,3,4,[5,6,[7,8]]]; console.log(arr1.flat(2)); //[1 阅读全文
摘要:
let str = ' iloveyou '; console.log(str); console.log(str.trimStart()); console.log(str.) 阅读全文
摘要:
// 二维数组 转为对象 const result = Object.fromEntries([ ['name','王蓉'],['study','skill'] ]) console.log(result); //{name:'wangrong',study:'skill'} //Map const 阅读全文