摘要: class Person { // 公有属性 name; // 私有属性 #age; #weight; // 构造方法 constructor(name,age,weight){ this.name = name; this.#age = age; this.#weight = weight; } 阅读全文
posted @ 2020-12-03 15:40 小蓉儿 阅读(101) 评论(0) 推荐(0) 编辑
摘要: // 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 阅读全文
posted @ 2020-12-03 15:23 小蓉儿 阅读(77) 评论(0) 推荐(0) 编辑
摘要: let str = ' iloveyou '; console.log(str); console.log(str.trimStart()); console.log(str.) 阅读全文
posted @ 2020-12-03 13:24 小蓉儿 阅读(74) 评论(0) 推荐(0) 编辑
摘要: // 二维数组 转为对象 const result = Object.fromEntries([ ['name','王蓉'],['study','skill'] ]) console.log(result); //{name:'wangrong',study:'skill'} //Map const 阅读全文
posted @ 2020-12-03 10:23 小蓉儿 阅读(282) 评论(0) 推荐(0) 编辑