js
文章平均质量分 87
前端客户端职业研发
科学研究,不断探索,步步实践
展开
-
js语法ES6、ES7、ES8、ES9、ES10、ES11、ES12的新特性
ES6(2015)1、let和const let name = 'john'; const arr = [];2、类(Class)class Man { constructor (name) { this.name = name; } console() { console.log(this.name); }}const man = new Man('john');man.console(); // john3、箭头函数(Arrow)const原创 2021-03-18 17:09:08 · 2594 阅读 · 0 评论 -
js - tips点
JSON.stringify(function (){})// undefinedclass Obj { constructor (){ } get () { console.log(1); }}typeof Obj// undefinedJSON.stringify(Obj);// undefined原创 2018-12-12 10:25:35 · 166 阅读 · 0 评论 -
使用 cdn.Polyfill向前兼容支持js新特性
现状我们想要用 ES6 语法来写 JavaScript。然而由于我们需要兼容老版本的浏览器,那些浏览器不支持 ES6,我们需要解决这个问题。有一个标准的做法是:写 ES6 代码 → 将所有代码编译成 ES5 的(比如通过 Babel)→ 再将编译后的代码加载到浏览器执行。改进方式有一个 polyfill 项目叫做 Polyfill.io API,它可以通过 polyfill 方式在客户端执...转载 2019-07-28 23:16:27 · 6263 阅读 · 1 评论