1. offset 系列属性简介 element.offsetWidth : 获取自身元素的宽度【padding + border + width】 element.offsetHeight :获取自身元素的高度 【padding + border + height】 element.offsetL Read More
posted @ 2021-08-10 15:27 TwinkleG Views(315) Comments(0) Diggs(0)
1. startswith() 方法,判断字符串是否以...开头 endswith() 方法,判断字符串是否以...结尾 还可以有第二个参数,表示position,从指定位置开始判断 let str = "Hello Webpack, nice to meet u"; console.log(str Read More
posted @ 2021-08-10 14:34 TwinkleG Views(43) Comments(0) Diggs(0)
1. find()方法 find()方法查找数组中符合条件的第一个元素,并将其返回;若未查找到,则返回undefined. let arr = [{ id: 1, name: "James" }, { id: 2, name: "Messy" }, { id: 3, name: "Messy" }] Read More
posted @ 2021-08-10 14:22 TwinkleG Views(49) Comments(0) Diggs(0)
1. 扩展运算符可以将数组拆分成以逗号分隔的序列 let arr = ['blue', 'pink', 'green']; ...arr // blue, pink, green console.log(...arr); // blue pink green 联想到 join() 方法 consol Read More
posted @ 2021-08-10 14:09 TwinkleG Views(208) Comments(0) Diggs(0)