Hello Guys, I’m sharing here “ How to Run URL one by one in for loop in JavaScript? ” Following the bellow example for the same:- //URL Array var linksArray = [ 'https://www.codefari.com/' , 'https://www.code-sample.xyz' , 'https://www.code-sample.com' ]; //Execute runURL method function runURL() { if (linksArray.length == 0) return ; var url = linksArray.shift(); var openWindow = window.open(url); setTimeout( function () { openWindow.close(); //Execute runURL method runURL(); }, 5000); } //Execute runURL method runURL();
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers