* A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function.
(array, callback)
| 63 | * @returns {Array} A new array of values returned by the callback function. |
| 64 | */ |
| 65 | function map(array, callback) { |
| 66 | const result = []; |
| 67 | let length = array.length; |
| 68 | while (length--) { |
| 69 | result[length] = callback(array[length]); |
| 70 | } |
| 71 | return result; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * A simple `Array#map`-like wrapper to work with domain name strings or email |
no test coverage detected