12 2020 档案

摘要:let data=[ { desc: ‘超清’,thumb:‘1’, code_url: ‘https://media.w3.org/2010/05/sintel/trailer.mp4’ }, { desc: ‘高清’,thumb:‘2’, code_url: ‘http://vjs.zencdn 阅读全文
posted @ 2020-12-29 17:29 小蓉儿 阅读(6214) 评论(0) 推荐(1) 编辑
摘要:https://www.toutiao.com/i6906751834489356808/ 阅读全文
posted @ 2020-12-17 09:50 小蓉儿 阅读(221) 评论(0) 推荐(0) 编辑
摘要:所谓数组扁平化就是将数组中并不规则的多维数组去除维度,使之变为一维数组。 let newArray = arr.flat(depth) flat() 方法会按照一个可指定的深度递归遍历数组,并将所有元素与遍历到的子数组中的元素合并为一个新数组返回。 其中,depth指定要提取嵌套数组的结构深度,默认 阅读全文
posted @ 2020-12-14 13:19 小蓉儿 阅读(2025) 评论(0) 推荐(1) 编辑
摘要:const p1 = new Promise((resolve, reject)=>{ setTimeout(()=>{ resolve('商品数据-1') },1000) }) const p2 = new Promise((resolve, reject)=>{ setTime(()=>{ // 阅读全文
posted @ 2020-12-04 09:41 小蓉儿 阅读(121) 评论(0) 推荐(0) 编辑
摘要:class Person { // 公有属性 name; // 私有属性 #age; #weight; // 构造方法 constructor(name,age,weight){ this.name = name; this.#age = age; this.#weight = weight; } 阅读全文
posted @ 2020-12-03 15:40 小蓉儿 阅读(105) 评论(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 小蓉儿 阅读(80) 评论(0) 推荐(0) 编辑
摘要:let str = ' iloveyou '; console.log(str); console.log(str.trimStart()); console.log(str.) 阅读全文
posted @ 2020-12-03 13:24 小蓉儿 阅读(75) 评论(0) 推荐(0) 编辑
摘要:// 二维数组 转为对象 const result = Object.fromEntries([ ['name','王蓉'],['study','skill'] ]) console.log(result); //{name:'wangrong',study:'skill'} //Map const 阅读全文
posted @ 2020-12-03 10:23 小蓉儿 阅读(290) 评论(0) 推荐(0) 编辑
摘要:let str = '<a href="http://www/baidu.com">百度</a>'; // 提取 url 和 文本 const reg = /<a href="(.*)>(.*)<\/a>/; const result = reg.exec(str); console.log(res 阅读全文
posted @ 2020-12-01 15:52 小蓉儿 阅读(83) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示