导入和导出
一 ECMAScript 6的导入和导出:import 、export 1 基本语法 import { dog , person , hero } from './common.js'; import { hello,Plane } from './common.js'; import { car , rain } from './common.js'; import shrimp from './common.js'; console.log(lottery); console.log(dog,person,hero); hello(); let plane = new Plane('波音787梦想飞机'); plane.fly(); console.log(car); rain(); console.log(shrimp); /****** 单个导出 ******/ // 导出变量 export var dog = '沙皮狗'; export let person = 'Leonardo Da Vinci'; export const hero = '常山赵子龙'; //导出函数 export function hello(){ console.log('hello'); } // 导出类 export class Plane{ constructor(name){ this