Created
August 21, 2019 05:42
-
-
Save docentedev/e3bda273d16169c7edaf00248739c7cd to your computer and use it in GitHub Desktop.
Functions and refactor to Arrow Functions
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
// 01 | |
// funcion | |
function a(n1, n2) { | |
return n1 + n2; | |
} | |
// funcion flecha refactorizada | |
const a = (n1, n2) => { | |
return n1 + n2; | |
}; | |
// 02 | |
// funcion | |
[1,2,3,4,5].map(function(e) { | |
return { | |
numero: e, | |
}; | |
}) | |
// funcion flecha refactorizada | |
[1,2,3,4,5].map(e => ({ numero: e })); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment