上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: 数组的解构赋值 对象的解构赋值 字符串的解构赋值 数值和布尔值的解构赋值 函数参数的解构赋值 圆括号问题 用途 https://wangdoc.com/es6/destructuring#navbar 网道 变量的解构赋值用途很多。 (1)交换变量的值 let x = 1; let y = 2; [ 阅读全文
posted @ 2024-06-02 12:22 ladybug7 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 块级作用域的出现,实际上使得获得广泛应用的匿名立即执行函数表达式(匿名 IIFE)不再必要了。 // IIFE 写法 (function () { var tmp = ...; ... }()); // 块级作用域写法 { let tmp = ...; ... } 阅读全文
posted @ 2024-06-01 13:14 ladybug7 阅读(5) 评论(0) 推荐(0) 编辑
摘要: Babel 默认只转换新的 JavaScript 句法(syntax),而不转换新的 API,比如 Iterator、Generator、Set、Map、Proxy、Reflect、Symbol、Promise 等全局对象,以及一些定义在全局对象上的方法(比如 Object.assign)都不会转码 阅读全文
posted @ 2024-06-01 11:30 ladybug7 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Babel 是一个广泛使用的 ES6 转码器,可以将 ES6 代码转为 ES5 代码,从而在老版本的浏览器执行。这意味着,你可以用 ES6 的方式编写程序,又不用担心现有环境是否支持。下面是一个例子。 // 转码前 input.map(item => item + 1); // 转码后 input. 阅读全文
posted @ 2024-06-01 11:18 ladybug7 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 1.概述事件发生以后,会产生一个事件对象,作为参数传递给监听函数。浏览器原生提供一个 Event 对象,所有的事件都是这个对象的实例,或者说继承了 Event.prototype 对象。Event 对象本身就是一个构造函数,可以用来生成新的实例。event = new Event(type, opt 阅读全文
posted @ 2024-05-27 14:53 ladybug7 阅读(4) 评论(0) 推荐(0) 编辑
摘要: function isPropertySupported(property) { if (property in document.body.style) return true; var prefixes = ['Moz', 'Webkit', 'O', 'ms', 'Khtml']; var p 阅读全文
posted @ 2024-05-27 09:07 ladybug7 阅读(4) 评论(0) 推荐(0) 编辑
摘要: PS F:\nodeDemo2> nrm -hUsage: cli [options] [command] Options: -V, --version output the version number -h, --help output usage information Commands: l 阅读全文
posted @ 2021-03-14 01:45 ladybug7 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 错误内容 internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, 'string', value); ^ [TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must b 阅读全文
posted @ 2021-03-14 01:43 ladybug7 阅读(627) 评论(0) 推荐(0) 编辑
摘要: Win10系统 安装 nrm 出现报错:nrm : 无法加载文件 C:\Program Files\nodejs\nrm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execu 阅读全文
posted @ 2021-03-14 01:42 ladybug7 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-01-28 10:25 ladybug7 阅读(40) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页