
ES6
qq_39218277
这个作者很懒,什么都没留下…
展开
-
gulp
gulp 插件主要用做文件压缩js css等使用方法gulp.task(‘任务名称’,()=>{gulp.src('绝对路径‘).pipe(gulp.dest(‘处理后存放位置’))})引用gulp模块const gulp = require('gulp');const htmlmin = require('gulp-htmlmin');const fileinclude = require('gulp-file-include');const less = require('gu原创 2020-05-26 18:46:36 · 109 阅读 · 0 评论 -
exports 与 module.exports readFile 与 writeFile path
exports暴露出方法让想调用的人requireconst add = (n1, n2) => n1 + n2;exports.add = add;const a = require('绝对路径');console.log(a.add(10, 20));module.exportsconst greeting = name => `hello ${name}`;const x = 100;exports.x = x;module.exports.greeting = g原创 2020-05-26 17:48:52 · 160 阅读 · 0 评论 -
es6基础
1.let const var 关键字/* --------let关键字就是用来声明变量的-------- */ // let a = 10; // console.log(a);/* --------使用let关键字声明的变量具有块级作用域-------- */ // if (true) { // let b = 20; // console.log(b) // if (true) { // let c = 30; // } // console.log(c); //原创 2020-05-26 16:43:57 · 113 阅读 · 0 评论