UNPKG

lenye_base

Version:

基础方法

10 lines (7 loc) 254 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;