Class A blueprint defining the charactaristics and behaviors of an object of that class type. Class names should be written in CamelCase, starting with a capital letter. class MyClass{ ... } Each class has two types of variables: class variables and…
sea-base.js /** * Sea.js 2.2.3 | seajs.org/LICENSE.md */ (function(global, undefined) { // Avoid conflicting when `sea.js` is loaded multiple times if (global.seajs) { return } var seajs = global.seajs = { // The current version of Sea.js being used…
最近在看es2015的一些语法,最实用的应该就是继承这个新特性了.比如下面的代码: $(function(){ class Father{ constructor(name, age){ this.name = name; this.age = age; } show(){ console.log(`我叫:${this.name}, 今年${this.age}岁`); } }; class Son extends Father{}; let son = new Son('金角大王', 200);…
原文地址:Setting up an ES6 Project Using Babel and Browserify JavaScript的发展日新月异,ES6很快就要接管JS了.很多著名的框架像AngularJS 2.React Native已经开始支持ES6了.我们是时候准备拥抱变化了,所以我们应该开始在几乎所有的浏览器支持之前使用ES6码代码了. 本文将要介绍如何使用Babel和Browerify来创建项目并且编写能够运行在老版本浏览器上的现代代码.Babel将ES6代码编译为大多数浏览器(…