UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

10 lines (7 loc) 251 B
'use strict'; /** * Creates a new string with the results of calling a provided function * on every character in the calling string. */ var mapString = (str, fn) => str.split('').map((c, i) => fn(c, i, str)).join(''); module.exports = mapString;