Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ArrayReplace

1
2
3
function arrayReplace(inputArray, elemToReplace, substitutionElem) {
    return inputArray.join(',').replace(new RegExp(elemToReplace, 'g'), substitutionElem).split(',').map(Number);
}
Source by wachino.github.io #
 
PREVIOUS NEXT
Tagged: #ArrayReplace
ADD COMMENT
Topic
Name
8+1 =