twoSum = (nums, target, map = new Map()) => {
    for (let index = 0; index < nums.length; index++) {/* Time O(N) */
        const num = nums[index];
        const complement = (target - num);
        const sumIndex = map.get(complement);

        const isTarget = map.has(complement)
        if (isTarget) return [ index, sumIndex ];

        map.set(num, index);                                /* Space O(N) */
    }

    return [ -1, -1 ];
}
Hash Map - 1 Pass
Time O(N) | Space O(N)
https://leetcode.com/problems/two-sum/
@param {number[]} nums
@param {number} target
@return {number[]}