js-kata-modules

1.0.0 • Public • Published

hikurangi-lisa-utils

map(func, arr):

var timesTwo = function (num) { return num * 2 } var someNumbers = [2, 4, 6] var actualNumbers = map(timesTwo, someNumbers) // actualNumbers = [4, 8, 12]

filter(func, arr): data = ["a string", "oh look, another string"] function filterStringsWithCommas (str) { return (str.indexOf(',') > -1); } var stringsWithCommas = filter(filterStringsWithCommas, data) // stringsWithCommas = ["oh look, another string"]

countIf(func, arr): var nums [1, 2, 3, 4, 5, 6] var count = countIf(isLessThan3, arr) // count = [1, 2]

Readme

Keywords

none

Package Sidebar

Install

npm i js-kata-modules

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • hikurangi