2 * Converts `map` to an array.
5 * @param {Object} map The map to convert.
6 * @returns {Array} Returns the converted array.
8 function mapToArray(map) {
10 result = Array(map.size);
12 map.forEach(function(value, key) {
13 result[++index] = [key, value];
18 module.exports = mapToArray;