Javascript sleep promise

javascript sleep
const sleep = ms => new Promise( r => setTimeout(r, ms));