Created
August 29, 2021 04:28
-
-
Save xvaldetaro/13fa939cfbef32afaeb696f2e91cf29f 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
function rMap(array, callback) { | |
// seu codigo | |
} | |
function rFilter(array, callback) { | |
// seu codigo | |
} | |
function rLength(array) { | |
return array.length | |
} | |
const aa = [1,2,3,4] | |
console.log(rLength(aa)) | |
let bb = rMap(aa, (element) => element + 1) | |
console.log(bb)// [2,3,4,5] | |
bb = aa.map((element) => element + 1) | |
console.log(bb)// [2,3,4,5] | |
bb = rFilter(aa, (element) => element > 2) | |
console.log(bb) // [3,4] | |
bb = aa.filter((element) => element > 2) | |
console.log(bb) // [3,4] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment