Files
lodash/_mapToArray.js
John-David Dalton 466c67a8b6 Bump to v4.1.0.
2016-01-29 01:20:57 -08:00

19 lines
350 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;
}
export default mapToArray;