User:Iritscen/vector.js: Difference between revisions

does "await" work or doesn't it?
(wait, why do I need to even look at what page I'm on if I'm no longer instructing MW to load a script?)
(does "await" work or doesn't it?)
Line 15: Line 15:
     ModifySidebar("add", "navigation", "Slaves of War", "http://wiki.oni2.net/Oni2:Slaves_of_War");
     ModifySidebar("add", "navigation", "Slaves of War", "http://wiki.oni2.net/Oni2:Slaves_of_War");
});*/
});*/
function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}
async function demo() {
  console.log('Taking a break...');
  await sleep(2000);
  console.log('Two second later');
}
demo();