Intervue.io interview question

1. split a string with multiple spaces 2. print console.log after 5 sec

Interview Answer

Anonymous

12 Oct 2025

1. str = " My Name is Abc" str.trim().split(/\s+/).join(" "); 2. use promise to wait