摘要: // 获取Unicode字符串const unicodeStr = String.fromCharCode(9731, 9733, 9842); // 解码Unicodeconst chineseStr = JSON.parse(`"${unicodeStr}"`); console.log(chi 阅读全文
posted @ 2023-11-17 09:22 青老师 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 13 个从 ES2021 到 ES2023 实用JavaScript 新特性技巧 (qq.com) 1.5万字概括ES6全部特性(已更新ES2020) - 掘金 (juejin.cn) 阅读全文
posted @ 2023-07-18 16:16 青老师 阅读(6) 评论(0) 推荐(0) 编辑
摘要: // 特殊类型 null a = null; a = Number(a); console.log("null a转换后类型 = " + typeof a); console.log("null a转换后的值 = " + a); // 特殊类型 undefined a = undefined; a 阅读全文
posted @ 2023-07-14 09:28 青老师 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 比如parseInt("021",8); // ->17 但是,如果第一个参数如果是Number呢? 比如parseInt(021,8); // ->15 原因:直接把021当成十进制Number来做int解析,发现021是八进制数,变成十进制数是17,再对17按8进制数形式做int解析。即: pa 阅读全文
posted @ 2023-07-14 08:55 青老师 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 1 let arr = [1, 2, 3, 4, 5] 2 3 let max = arr.reduce((prev, cur) => { 4 return Math.max(prev, cur) 5 }) 6 7 console.log(max) // expected output: 5 // 阅读全文
posted @ 2023-07-13 13:58 青老师 阅读(11) 评论(0) 推荐(0) 编辑
摘要: // 防抖函数 function debounce(func, wait) { // 创建一个定时器 let timeout // 返回一个函数,这个函数会在一个时间区间结束后调用 func return function() { // 如果定时器还在运行,则清除定时器 timeout && cle 阅读全文
posted @ 2023-07-12 17:18 青老师 阅读(9) 评论(0) 推荐(0) 编辑
摘要: vue $attrs和$listeners的使用 - 掘金 (juejin.cn) 阅读全文
posted @ 2023-07-11 14:12 青老师 阅读(10) 评论(0) 推荐(0) 编辑
摘要: JavaScript作用域和闭包 - 程序猿的程 - 博客园 (cnblogs.com) 详谈JavaScript原型链 - 程序猿的程 - 博客园 (cnblogs.com) 详谈Javascript类与继承 - 程序猿的程 - 博客园 (cnblogs.com) 阅读全文
posted @ 2023-07-10 16:25 青老师 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-07-10 16:17 青老师 阅读(8) 评论(0) 推荐(0) 编辑
摘要: { "Print to console": { "prefix": "vue", "body": [ "<template>", "<div>\n", "</div>", "</template>\n", "<script>", "export default {", " name: '',", &qu 阅读全文
posted @ 2021-04-25 12:00 青老师 阅读(260) 评论(0) 推荐(0) 编辑