Question: Use ES6 syntax. Make sure you are using let/const properly. Use the built in http api. Do not use any npm modules. 1. Using callbacks


Use ES6 syntax. Make sure you are using let/const properly. Use the built in http api. Do not use any npm modules. 1. Using callbacks print the URLs in order according to their response time. (25 pts) Requirements Use Callbacks Do not block or make a synchronous function for getting times. Just use http.get getTimes(argument, callback) This function gets the response time from the http request. it calls back to the the calling function. orderTimes(sample) This function should call getTimes(...) and then order the times. HINT: use new Date Note The exact times do not matter - only make sure they are ordered low to high const sample - [ , http : //www. google. com/ http://www.spotify.com/us/', 'http : //twitter. com/ http://google.comothing' // Example Printout // { url: 'http://google.comothing., time : 18 }, /Iurl: 'https://www.google.com/', time: 21 // url: 'https://twitter.com/', time: 31 /Iurl: https://www.spotify.com/us/', time: 279 )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
