分类:js

js

js数字转为数组

js数字转为数组
var str = "123456789"; strCollection = converStr(str).split(","); function converStr(str){//给数字字符串添加逗号分隔符 if(/\...

4年前 (2021-10-28) 喜欢

js hex颜色转rgba

js hex颜色转rgba
代码 const hexToRgba = (hex, opacity) => { let rgbaColor = '' const reg = /^#[\da-f]{6}$/i if (reg.test(hex...

4年前 (2021-10-25) 喜欢

js移出对象中的空字段

js移出对象中的空字段
方法 function toType (obj) { return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() } function filterNull (o) { for (var...

4年前 (2021-10-12) 喜欢