DEV Community

Discussion on: ES6 Arrow Functions Cheatsheet

Collapse
 
qm3ster profile image
Mihail Malo • Edited

No, the real WUT is this:

let fn = (a, b) => a, b
fn('a','b') // It won't be 'b' :)

fn = (a, b) => (a, b)
fn('a','b') // Now it will.

// Honorable mention:
fn = ((a, b) => a, b)
fn('a','b') // Uncaught TypeError: fn is not a function
// (It's actually the `undefined` `b` declared at line 1:23)
// How excellent is that?!