文章分类 -  JavaScript

摘要:数字转为大写字母: String.fromCharCode(1 +'A'.charCodeAt() - 1 ) 数字转为小写字母: String.fromCharCode(1 +'a'.charCodeAt() - 1 ) 注:修改对应数据便改变字母。 字母转数字: "A".charCodeAt() 阅读全文
posted @ 2022-10-11 10:13 保洁叔叔 阅读(1788) 评论(0) 推荐(0)
摘要:date = "2022年4月18日" getDate(date){ let time = date; time = time.replace(/([年月])/g, '-'); time = time.replace(/日/g, ''); return time } 阅读全文
posted @ 2022-04-18 15:36 保洁叔叔 阅读(582) 评论(0) 推荐(0)
摘要:深拷贝对象: Object.assign({},obj) 深拷贝数组: arr.concat() 深拷贝对象数组: dataCopy(data){ let dataSouce = data instanceof Array ? [] : {} for(let item in data){ dataS 阅读全文
posted @ 2021-10-28 11:35 保洁叔叔 阅读(33) 评论(0) 推荐(0)