// console.log(1) //1 // let promise= new Promise((resolve,reject)=>{ // console.log(2) // setTimeout(() => { // console.log(12) // resolve('foo'); // }, 10); // }) // console.log(3) //3 // promise // .then(data=>{ // console.log(4,data) // }) // .catch(data=>{ // console.log(5,data) // }) // console.log(7) // setTimeout(()=>{ // console.log(6) // },0) // //macro --6, (foo12) // //1 // //3 // //7 // //2--> // //6 // //12 // //4 ,foo //Question: Given an array of integers, find two numbers such that they add up to a specific target value. Implement the function and optimize it for time complexity. // nums = [ 7, 11, 15,5] // target = 7 // //output: [0,1] // let map =new Map(); // // { } // for(let i=0;i<nums.length;i++){ // let varFind = target-nums[i]; // if(map.has(varFind)){ //...