Skip to content

Instantly share code, notes, and snippets.

@wklug
Created October 27, 2016 03:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wklug/5b0a614835a7fb302cd4e2561b2d4246 to your computer and use it in GitHub Desktop.
Save wklug/5b0a614835a7fb302cd4e2561b2d4246 to your computer and use it in GitHub Desktop.
ES6 - Empty Arrow functions return
/**
* ES6 - Arrow functions.
*
* Empty arrow functions return `undefined`. The same as normal functions.
**/
let emptyness = () => {};
console.log(emptyness()); // undefined
var completelyEmpty = function() {
};
console.log(completelyEmpty()); // undefined
@the-stas
Copy link

what if Babel used for transpiling ES6 to ES5?
see https://stackoverflow.com/a/55336838/8521615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment