Last active
April 29, 2017 03:40
-
-
Save hrajchert/f1d5fa96873728f7c8f9da750b4adf04 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
// ES6 (arrow function) | |
var miArray = [1, 2, 3]; | |
miArray | |
// mas corta | |
.map(function (v) { | |
return v * 2; | |
}) | |
// Con parentesis | |
.filter(function (v) { | |
return v > 3; | |
}) | |
// Multiples argumentos | |
.sort(function (a, b) { | |
return b - a; | |
}) | |
// Bloque de codigo | |
.map(function (v) { | |
console.log('una cosa'); | |
console.log('otra cosa'); | |
return 'otra otra cosa'; | |
}); | |
// Ejercicio | |
var miFuncion = function (a, b, c) { | |
console.log('a', a); | |
return a - b * 2 + c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment