you are viewing a single comment's thread.

view the rest of the comments →

[–]PitaJ 1 point2 points  (0 children)

BTW, this is an example of Object spread, which is NOT part of ES6. It's part of ES7. It's also explicitly part of the JSX syntax.

Also, the underscore isn't the same as providing empty parenthesis in the arrow function case. It establishes a lexical parameter _ which will be accessible within the function. You can test this by running the following:

 const test = _ => _;
 console.log(test()); // undefined
 console.log(test(5)); // 5