Dunking
Training Plan:
Day 1:
- Squats (3 Sets of 5 Reps)
- Lunges (3 Sets of 10 Reps)
- Frog Jumps (5 Sets of 10 Reps)
- Box Jumps (3 Sets of 10 Reps)
/** | |
* 单例模式 | |
* 避免重复创建相同对象 | |
* example: | |
* let a = new TestClass(); | |
* let b = new TestClass(); | |
* a === b // false | |
* 如何a===b 为 true | |
*/ |
function Car() { | |
console.log(this); | |
console.log(this instanceof Car); | |
this.a = 'i am a '; | |
} | |
var t = new Car(); | |
var tt = Car(); | |
console.log(t); |
let carFactory = (function (name) { | |
function Benz() { | |
this.name = 'benz'; | |
} | |
function BMW() { | |
this.name = 'bmw'; | |
} | |
return function(name) { | |
switch (name) { | |
case 'benz': |
function PubSub() { | |
this.eventList = []; | |
} | |
PubSub.prototype.subscrible = function (eventName, callback) { | |
const currentEvent = this.eventList.find(obj => obj && obj.name === eventName); | |
if (currentEvent) { | |
this.eventList.find(obj => obj && obj.name === eventName).callback = callback; | |
} else { | |
this.eventList.push({ name: eventName, callback, }); |
/** | |
* 步骤 | |
* 1. 先读取文件夹 再 读取所有的json文件 | |
* 2. 再依次读取json内容 | |
* 3. 替换文件中的内容 | |
* 4. 写新的文件 到dist文件夹 | |
*/ | |
function minifyJson(rootPath) { | |
const saveDirName = 'dist'; | |
const baseFolderName = path.basename(rootPath); |
{ | |
"rules": { | |
"no-unused-expression": true, | |
"no-duplicate-variable": true, | |
"no-unused-variable": true, | |
"curly": false, | |
"class-name": true, | |
"semicolon": [true,"always"], | |
"triple-equals": true, | |
"no-var-requires": false, |
Dunking
Training Plan:
Day 1:
webpackJsonp([0],[ | |
/* 0 */, | |
/* 1 */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | |
const a = 2; | |
/* harmony default export */ __webpack_exports__["default"] = (a); | |
function run() { |
webpackJsonp([0],{ | |
/***/ 9: | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true |
if (process.env.NODE_ENV === undefined) { | |
process.env.NODE_ENV = 'development'; | |
} | |
const webpack = require('webpack'); | |
const brfs = require('brfs'); | |
const autoprefixer = require('autoprefixer'); | |
const libraryName = process.env.NODE_ENV === 'development' ? '[name]' : '[name]_[chunkhash]'; | |
const styleLoaderName = 'style-loader'; |