1.0.0 • Published 8 years ago

js-kata-modules v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

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