LoginSignup
1
1

More than 5 years have passed since last update.

JavaScript - function syntax between ES5 and ES6

Last updated at Posted at 2019-03-14
ES5
function foo() {
...
}

foo();
ES6
const foo = () => {
...
}

foo();
ES5_Return
function foo() {
    return 'Hello Taiwan';
}
ES6_Return
const foo = () => 'Hello Taiwan';
ES5_Return_Parameters
function foo(a, b) {
    return a+b;
}
ES6_Return_Parameters
const foo = (a, b) => a+b;

https://medium.freecodecamp.org/es6-functions-9f61c72b1e86
https://pjchender.blogspot.com/2017/01/es6-arrow-function.html
https://medium.com/@thejasonfile/es5-functions-vs-es6-fat-arrow-functions-864033baa1a

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1