Skip to content

Instantly share code, notes, and snippets.

@xvaldetaro
Created August 29, 2021 04:28
Show Gist options
  • Save xvaldetaro/13fa939cfbef32afaeb696f2e91cf29f to your computer and use it in GitHub Desktop.
Save xvaldetaro/13fa939cfbef32afaeb696f2e91cf29f to your computer and use it in GitHub Desktop.
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