Semrush interview question

How to write down a function in JS which will send API call and cancel it if it didn't finish in 5 sec.

Interview Answer

Anonymous

14 Dec 2024

Promise.race() is the answer