Created
March 13, 2021 08:00
-
-
Save NovoManu/5c3f7be6cb1fca27908744f49f9fe8b3 to your computer and use it in GitHub Desktop.
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
// One line return | |
const increment1 = (number) => ++number | |
// or without parentheses | |
const increment2 = number => ++number | |
// Analog in ES5 | |
var increment3 = function(number) { | |
return ++number | |
} | |
// One line return object | |
const returnObj1 = () => ({ a: 1, b: 2 }) | |
// Analog in ES5 | |
var returnObj2 = function() { | |
return { a: 1, b: 2 } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment