$ node -v
v4.6.0
$ npm -v
3.10.6
$ yarn -V # or this
0.15.1
var sqr = function (x) { return x * x; };
// is the same as...
var sqr = (x) => x * x;
var goodMorning = '早安您好', happy = '平安喜樂', share = '分享';
console.log(goodMorning + ',' + happy + ',認同請' + share + '。');
console.log(`${goodMorning},${happy},認同請${share}。`);
自介
Prologue
$ node -v
v4.6.0
$ npm -v
3.10.6
$ yarn -V # or this
0.15.1
先備知識
REPL
JavaScript 語法複習 + ES6
var sqr = function (x) { return x * x; };
// is the same as...
var sqr = (x) => x * x;
var goodMorning = '早安您好', happy = '平安喜樂', share = '分享';
console.log(goodMorning + ',' + happy + ',認同請' + share + '。');
// is the same as...
console.log(`${goodMorning},${happy},認同請${share}。`);
Dive into the world of Node