function add(x) {
// x = 1
console.log(`first outer function argument x =`, x);
return function (y) {
// y = 41
console.log(`second inner function argument y =`, y);
return x + y;
};
}
const incremenent1 = add(1);
increment1(41); // 42
import defaultExport from "module-name";
import * as name from "module-name";
import { export } from "module-name";
import { export as alias } from "module-name";
import { export1 , export2 } from "module-name";
import { export1 , export2 as alias2 , [...] } from "module-name";
import defaultExport, { export [ , [...] ] } from "module-name";
import defaultExport, * as name from "module-name";
import "module-name";
export { name1, name2, …, nameN };
export { variable1 as name1, variable2 as name2, …, nameN };
export let name1, name2, …, nameN; // also var, function
export let name1 = …, name2 = …, …, nameN; // also var, const
export default expression;
export default function (…) { … } // also class, function*
export default function name1(…) { … } // also class, function*
export { name1 as default, … };
export * from …;
export { name1, name2, …, nameN } from …;
export { import1 as name1, import2 as name2, …, nameN } from …;
ES6 Modules
https://developer.mozilla.org/zh-CN/
https://weblogs.asp.net/dwahlin/getting-started-with-es6-%E2%80%93-transpiling-es6-to-es5 https://github.com/danwahlin/es6samples
https://webpack.js.org/concepts/loaders/
https://webpack.js.org/loaders/babel-loader/#src/components/Sidebar/Sidebar.jsx
https://webpack.js.org/loaders/
https://babeljs.io/docs/usage/api/#options https://babeljs.io/docs/plugins/#presets
babel-preset-env
replaceses2015, es2016, es2017, latest
https://babeljs.io/docs/plugins/preset-es2015/
https://babeljs.io/docs/plugins/transform-es2015-arrow-functions/
.babelrc
$ npm i -D babel-cli babel-preset-es2015
https://babeljs.io/docs/usage/cli/
https://babeljs.io/docs/usage/api/#options
https://webpack.js.org/configuration/module/#rule-options-rule-query
https://moduscreate.com/blog/optimizing-react-es6-webpack-production-build/
{ "presets": ["es2015", "react"] }
https://moduscreate.com/blog/optimizing-react-es6-webpack-production-build/
https://github.com/babel/babel-preset-env/issues/186
https://github.com/webpack/webpack/issues/2785
https://stackoverflow.com/questions/36986133/couldnt-find-preset-es2015-relative-to-directory
{ "presets": ["preset-env"] }
https://doc.webpack-china.org/configuration/
https://webpack.js.org/configuration/
https://webpack.js.org/configuration/module/#rule-use https://webpack.js.org/configuration/module/#rule-loader
https://webpack.js.org/configuration/module/#module-rules
https://webpack.js.org/configuration/module/#useentry
https://webpack.js.org/configuration/module/#rule-test
{ loader: "css-loader", options: { modules: true } }
presets: ['env']
https://github.com/webpack/webpack/issues/2785
http://www.css88.com/doc/webpack/loaders/babel-loader/
https://babeljs.io/docs/plugins/preset-env
https://babeljs.io/docs/plugins/preset-env#examples
https://babeljs.io/docs/plugins/preset-env#examples
babel-plugin-transform-object-rest-spread
https://babeljs.io/docs/plugins/transform-object-rest-spread/
https://www.npmjs.com/package/babel-plugin-transform-object-rest-spread
https://babeljs.io/docs/plugins/syntax-object-rest-spread/
https://www.sitepoint.com/modular-javascript-systemjs-jspm/ https://github.com/systemjs/plugin-babel https://github.com/systemjs/systemjs
https://github.com/ModuleLoader/es-module-loader https://github.com/ModuleLoader/browser-es-module-loader https://github.com/ModuleLoader/browser-es-module-loader/blob/master/package.json
/usr/local/apache2/webapps/information
/usr/local/apache2/webapps/information/reportinfo
/usr/local/apache2/webapps/information/bulletininfo
face, 😑 😩 🤖 🦊 😒 😧 😟 🐭 🐻 🤓 😪 🦁 🐹 😌 😢 😠 🤗 🐮 😞
https://emojipedia.org/search/?q=face
http://localhost:3000/000-xyz/modal/index.html
??? proxy ???
http://10.1.5.202/information/newsinfo/
http://10.1.5.202/queryservice/news/content/564082427896
// 研报 摘要 http://10.1.5.202/webservice/researchreport/research/zy/551173471225
字体:大 中 小 12px 14px 16px
Blockchain Fundamentals
solidity
.sol
Introduction to Bitcoin and Decentralized Technology
https://medium.freecodecamp.org/lets-learn-javascript-closures-66feb44f6a44#.dr9v9ufob
Currying
import
export
$ browser-sync start --server --files "./fast-preview/."
Babel CLI and a preset
https://babeljs.io/ https://babeljs.io/docs/setup
https://babeljs.io/users/ https://github.com/babel/website/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+%22New+User%3A%22 https://jakearchibald.github.io/svgomg/
babel-standalone
https://babeljs.io/docs/setup#installation
Babel CLI
https://babeljs.io/docs/setup#installation
Webpack
https://webpack.js.org/concepts/ https://github.com/webpack/webpack https://doc.webpack-china.org/
https://github.com/babel/babel-loader
bundler & loader
webpack/browserify
Next-generation ES6 module bundler
https://rollupjs.org/ https://rollupjs.org/repl https://github.com/rollup/rollup
Streaming build system
https://gulpjs.com/ https://github.com/gulpjs/gulp
JavaScript Task Runner
https://gruntjs.com/ https://github.com/gruntjs/grunt
A bundler for javascript and friends.
https://webpack.js.org/concepts/ https://github.com/webpack/webpack https://doc.webpack-china.org/
A JavaScript file and module loader
http://www.requirejs.org/ http://www.requirejs.org/docs/start.html
http://www.requirejs.org/docs/download.html#requirejs
http://www.requirejs.org/docs/jquery.html#modulename https://github.com/requirejs/requirejs/wiki/Upgrading-to-RequireJS-2.0
browser-side require() the node.js way
https://browserify.org/
https://github.com/browserify/browserify
AMD
https://github.com/amdjs/amdjs-api/wiki/AMD https://github.com/amdjs/amdjs-api/wiki/AMD-(中文版)
https://github.com/amdjs/amdjs-api/wiki/require https://github.com/amdjs/amdjs-api/wiki/require-(中文版)
CommonJS
http://wiki.commonjs.org/wiki/CommonJS http://wiki.commonjs.org/wiki/Modules/1.1.1 http://wiki.commonjs.org/wiki/Modules/Transport http://wiki.commonjs.org/wiki/Modules/Async/A
https://github.com/commonjs/commonjs http://commonjs.org/
http://www.requirejs.org/docs/commonjs.html http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.
https://github.com/umdjs/umd
https://www.gigmasters.com/mobile-dj/cmdjs
AMD vs Common JS & UMD
https://www.linkedin.com/pulse/amd-vs-common-js-umd-damodaran-sathyakumar
http://blog.millermedeiros.com/amd-is-better-for-the-web-than-commonjs-modules/ http://tagneto.blogspot.com/2012/01/reply-to-tom-on-amd.html http://unscriptable.com/2011/09/30/amd-versus-cjs-whats-the-best-format/
What Is AMD, CommonJS, and UMD?
https://www.davidbcalhoun.com/2014/what-is-amd-commonjs-and-umd/
JavaScript Modules: A Beginner’s Guide
https://medium.freecodecamp.org/javascript-modules-a-beginner-s-guide-783f7d7a5fcc
https://github.com/Medium https://medium.com/@GitHub
https://medium.com/@xgqfrms
decodeURIComponent
https://stackoverflow.com/questions/38638210/how-to-use-umd-in-browser-without-any-additional-dependencies
babel/plugin
https://babeljs.io/docs/plugins/transform-class-properties/
https://babeljs.io/docs/plugins/transform-object-rest-spread
module formats & module loaders
server side js (node.js & Sync)
browser side js (Async)
build-in module loader (node.js)
TypeScript & Babel
ES6 Module
SystemJS-system.register
CommonJS shortcut