array-replace
Replace array values with String.prototype.replace
Install
$ npm install --save array-replace
Usage
const arrayReplace = ;const arr = 'foo' 'bar'; ;//=> ['yo', 'bar'] ;//=> ['FOo', 'bar']
API
arrayReplace(input, search, replace)
Returns a new array.
input
Required
Type: array
The array to replace values in.
search
Required
Type: string
or regexp
Search for matching substring that will be replaced.
replace
Required
Type: string
or function
Replacing the matching substring.
Related
- key-replace - Replace object keys with
String.prototype.replace
License
MIT © Andreas Gillström