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

Dec 14, 2024

Promise.race() is the answer