With ECMAscript 6 we get the luxury of default parameters for our functions.
I run the code , but there is SyntaxError:
/usr/local/Cellar/node/5.6.0/bin/node --use-strict /Users/huanghaitao/WebstormProjects/es6/default.js /Users/huanghaitao/WebstormProjects/es6/default.js:5 let receive = (complete = () => console.log("complete")) => complete() ^
SyntaxError: Unexpected token = at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:140:18) at node.js:1001:3
Process finished with exit code 1
the config not right?
you don't have es6 enabled.
Love the one liner at the end.
Could you please tell me how you are running app.js in the built in terminal? Thanks
Press the green "play" button, or Shift+F10 ( in case of webStorm)