Last active
July 21, 2016 15:31
-
-
Save lulalachen/54595ad8efdb3cf13aeb69d830699a69 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 | |
const add = firstNumber = secondNumber => firstNumber + secondNumber | |
// ES5 | |
var add = function (firstNumber) { | |
return function (secondNumber) { | |
return firstNumber + secondNumber | |
} | |
} | |
// ----- // | |
// ES6 | |
const map = funcA = arrayA => arrayA.map(element => funcA(element)) | |
// ES5 | |
var map = function (funcA) { | |
return function (arrayA) { | |
tempArray = [] | |
arrayA.map(function(element) { | |
tempArray.push(funcA(element)) | |
}) | |
return tempArray | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment