Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a more useful example for arrow functions #17

Closed
maxdow opened this issue Jul 11, 2016 · 0 comments
Closed

Provide a more useful example for arrow functions #17

maxdow opened this issue Jul 11, 2016 · 0 comments
Assignees

Comments

@maxdow
Copy link

maxdow commented Jul 11, 2016

In the example you use a primitive as a return value and you talk about "concise body" . Maybe it can be confuse because a function is not needed here.

As an example you could use an addition

var addition= function(a,b) {
    return a+b;
};

// Implementation with Arrow Function
var addition= (a,b) => a+b;

It demonstrates the gain of using es6 syntax and you don't have to write a notice

@metagrover metagrover self-assigned this Jul 11, 2016
carletex added a commit to carletex/ES6-for-humans that referenced this issue Aug 16, 2016
metagrover pushed a commit that referenced this issue Aug 16, 2016
* Arrow functions (#28)

* Section 1: let, const and block scoping

1. Add examples for let and const.
2. Add full version of TypeError from Chrome console.

* Arrow functions

Add a comment «Classical Function Expression»

* Index

* Fix anchors

* Fix "Object" typo

* Tranlation: #1

* Translation: #2

* Translation: #3

* Translation: #4

* Translation: #5

* Translation: #6

* Translation: #7 and #8

* Translation: #9

* Translation: #10

* Translation: #11

* Translation: #12

* Translation: #13, #14, #15, #16, #17

* Review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants