Files
lodash/_mapToArray.js
John-David Dalton bbd78fee4d Bump to v4.1.0.
2016-01-29 08:30:29 -08:00

19 lines
352 B
JavaScript

/**
* Converts `map` to an array.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the converted array.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;