two-sum
var twoSum = function (nums, target) {
const newmap = new Map();
for (let i = 0; i < nums.length; i++) {
const number = target - nums[i];
if (newmap.has(number)) {
return [newmap.get(number), i];
} else {
newmap.set(nums[i], i);
}
}
};