22

为什么说ES6的class是语法糖?

 5 years ago
source link: https://juejin.im/post/5c820d0e6fb9a04a0c2f3e12
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
0. 前言 我们带着问题去阅读本文: 为什么说ES6的class是语法糖? class是原型的语法糖吗? 那又是如何使用原型来实现class这一语法糖的呢? 1. 基于Prototype的OOP 先来看一个prototype的例子: function Pe

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK