From 1988653ccbd84ad7055100700db34e9c860739fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B3=BD=E6=9D=B0?= Date: Tue, 14 Sep 2021 20:34:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?class=20=E8=AF=A6=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e35fe96..e7a465a 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,15 @@ JS 数据类型分为两大类及八种数据类型,注意别漏了 ES6 新增 - [ ] 推荐文章 - [ ] [You Don't Know JS 书中关于类型转换的一章节](https://github.com/weiqinl/You-Dont-Know-JS-CN/blob/master/types%20%26%20grammar/ch4.md) +### Class(类) + +ES6提供了更接近面向对象(javascript本质上是基于对象的语言)语言的写法,引入了Class(类)这个概念,作为对象的模板。通过class关键字,可以定义类。 基本上,ES6的class可以看作只是一个语法糖,它的绝大部分功能,ES5都可以做到,新的class写法只是让对象原型的写法更加清晰、更像面向对象编程的语法而已 + +- [ ] 文档 + - [ ] [Class](https://developer.mozilla.org/en-US/docs/Glossary/Class) +- [ ] 推荐文章 + - [ ] [ECMAScript 6 入门之Class ](https://es6.ruanyifeng.com/#docs/class) + - [ ] [详解Class ](https://juejin.cn/post/6844904086089760775#heading-15) ## 十五万字面试资料 [在线阅读](https://yuchengkai.cn/home/) From 60f74d49bc4fe3afd7e73f01cc6860242f1097b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B3=BD=E6=9D=B0?= Date: Tue, 14 Sep 2021 21:18:17 +0800 Subject: [PATCH 2/4] JavaScript Class --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7a465a..92d4dce 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,9 @@ ES6提供了更接近面向对象(javascript本质上是基于对象的语言 - [ ] 文档 - [ ] [Class](https://developer.mozilla.org/en-US/docs/Glossary/Class) - [ ] 推荐文章 - - [ ] [ECMAScript 6 入门之Class ](https://es6.ruanyifeng.com/#docs/class) - - [ ] [详解Class ](https://juejin.cn/post/6844904086089760775#heading-15) + - [ ] [理解JavaScript的类](https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript) + - [ ] [Babel 是如何编译 Class 上](https://github.com/mqyqingfeng/Blog/issues/105) + - [ ] [Babel 是如何编译 Class 下](https://github.com/mqyqingfeng/Blog/issues/106) ## 十五万字面试资料 [在线阅读](https://yuchengkai.cn/home/) From b310e275e3d24e37f664efde221b45f0ffa07794 Mon Sep 17 00:00:00 2001 From: Brave-Jason Date: Tue, 14 Sep 2021 13:42:22 +0000 Subject: [PATCH 3/4] Commit from GitHub Actions (markdown-autodocs) --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d84fce0..978cf99 100644 --- a/README.md +++ b/README.md @@ -89,18 +89,17 @@ JS 数据类型分为两大类及八种数据类型,注意别漏了 ES6 新增 - [ ] 推荐文章 - [ ] [You Don't Know JS 书中关于类型转换的一章节](https://github.com/weiqinl/You-Dont-Know-JS-CN/blob/master/types%20%26%20grammar/ch4.md) - ### Class(类) -ES6提供了更接近面向对象(javascript本质上是基于对象的语言)语言的写法,引入了Class(类)这个概念,作为对象的模板。通过class关键字,可以定义类。 基本上,ES6的class可以看作只是一个语法糖,它的绝大部分功能,ES5都可以做到,新的class写法只是让对象原型的写法更加清晰、更像面向对象编程的语法而已 +ES6 提供了更接近面向对象(javascript 本质上是基于对象的语言)语言的写法,引入了 Class(类)这个概念,作为对象的模板。通过 class 关键字,可以定义类。 基本上,ES6 的 class 可以看作只是一个语法糖,它的绝大部分功能,ES5 都可以做到,新的 class 写法只是让对象原型的写法更加清晰、更像面向对象编程的语法而已 - [ ] 文档 - [ ] [Class](https://developer.mozilla.org/en-US/docs/Glossary/Class) - [ ] 推荐文章 - - [ ] [理解JavaScript的类](https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript) + - [ ] [理解 JavaScript 的类](https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript) - [ ] [Babel 是如何编译 Class 上](https://github.com/mqyqingfeng/Blog/issues/105) - [ ] [Babel 是如何编译 Class 下](https://github.com/mqyqingfeng/Blog/issues/106) - + ### this `this` 算是不少初学者容易搞混的一个知识点,但是它很重要,务必掌握。 @@ -205,7 +204,6 @@ ES6提供了更接近面向对象(javascript本质上是基于对象的语言 - [How We Build Micro Frontends](https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc) - [Revolutionizing Micro Frontends with Webpack 5, Module Federation and Bit](https://blog.bitsrc.io/revolutionizing-micro-frontends-with-webpack-5-module-federation-and-bit-99ff81ceb0) - ## 十五万字面试资料 [在线阅读](https://yuchengkai.cn/home/) From 13ef9143cc1d8667ddba8381d4ef7d0f9eea094e Mon Sep 17 00:00:00 2001 From: yck Date: Tue, 14 Sep 2021 22:06:55 +0800 Subject: [PATCH 4/4] Update README.md --- README.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 978cf99..dfabf22 100644 --- a/README.md +++ b/README.md @@ -89,17 +89,6 @@ JS 数据类型分为两大类及八种数据类型,注意别漏了 ES6 新增 - [ ] 推荐文章 - [ ] [You Don't Know JS 书中关于类型转换的一章节](https://github.com/weiqinl/You-Dont-Know-JS-CN/blob/master/types%20%26%20grammar/ch4.md) -### Class(类) - -ES6 提供了更接近面向对象(javascript 本质上是基于对象的语言)语言的写法,引入了 Class(类)这个概念,作为对象的模板。通过 class 关键字,可以定义类。 基本上,ES6 的 class 可以看作只是一个语法糖,它的绝大部分功能,ES5 都可以做到,新的 class 写法只是让对象原型的写法更加清晰、更像面向对象编程的语法而已 - -- [ ] 文档 - - [ ] [Class](https://developer.mozilla.org/en-US/docs/Glossary/Class) -- [ ] 推荐文章 - - [ ] [理解 JavaScript 的类](https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript) - - [ ] [Babel 是如何编译 Class 上](https://github.com/mqyqingfeng/Blog/issues/105) - - [ ] [Babel 是如何编译 Class 下](https://github.com/mqyqingfeng/Blog/issues/106) - ### this `this` 算是不少初学者容易搞混的一个知识点,但是它很重要,务必掌握。 @@ -146,6 +135,19 @@ ES6 提供了更接近面向对象(javascript 本质上是基于对象的语 - [ ] [JS 的 new 到底是干什么的?](https://zhuanlan.zhihu.com/p/23987456) - [ ] [JavaScript 深入之 new 的模拟实现](https://github.com/mqyqingfeng/Blog/issues/13) +### Class(类) + +`class` 只是原型链的语法糖,与其它语言中的类不是同一样东西。 + +- [ ] 文档 + - [ ] [Class](https://developer.mozilla.org/en-US/docs/Glossary/Class) +- [ ] 推荐文章 + - [ ] [理解 JavaScript 的类](https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript) + - [ ] [Babel 是如何编译 Class 上](https://github.com/mqyqingfeng/Blog/issues/105) + - [ ] [Babel 是如何编译 Class 下](https://github.com/mqyqingfeng/Blog/issues/106) + - [ ] [给 ES6 class 说句公道话](https://juejin.cn/post/6924108426125508616) + - [ ] [应该在JavaScript中使用Class吗?](https://zhuanlan.zhihu.com/p/158956514) + ### 事件循环 大家都知道 JS 是一门单线程的非阻塞的脚本语言。这也就意味着,代码在执行的任何时候只有一个主线程来处理所有的任务。所以弄懂事件循环机制对我们学习 JS 至关重要。