随笔分类 -  ES6

浅谈:es6 super
摘要:es6里面class的继承这一章, 对super一些概念上的理解,通过查询网上大神们的见解,来加深自己的理解: class A { constructor() { this.x = 1; } } class B extends A { constructor() { super(); this.x 阅读全文

posted @ 2020-06-07 13:05 文艺小书生 阅读(539) 评论(0) 推荐(0)

浅谈:export default与export const的区别
摘要:export default与export const的区别 export 用于在JavaScript模块中导出函数,原始值,对象;即导出模块,例如: export (命名导出) export {myFunction}; //命名导出函数 export const value=5; //命名导出原始 阅读全文

posted @ 2020-05-29 23:00 文艺小书生 阅读(13580) 评论(4) 推荐(1)

浅谈:ES6语法中的解构赋值
摘要:<script>function sum(x, y, z) { let total = 0; if (x) total += x; if (y) total += y; if (z) total += z; console.log(`total:${total}`); // 注意(``)中的`是tab键上方的按键按下产生的,不是单引号}sum(5, "", 9); // total:14funct 阅读全文

posted @ 2020-04-24 18:16 文艺小书生 阅读(198) 评论(0) 推荐(0)

导航