Created
October 27, 2016 03:44
-
-
Save wklug/5b0a614835a7fb302cd4e2561b2d4246 to your computer and use it in GitHub Desktop.
ES6 - Empty Arrow functions return
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what if Babel used for transpiling ES6 to ES5?
see https://stackoverflow.com/a/55336838/8521615