function wait (callback, ms) {
  return new Promise(resolve => {
    setTimeout(() => resolve(callback()), ms || 0)
  })
}
// Wait a specific time before executing a callback
Wait a specific time before executing a callback
Wait a specific time before executing a callback
function wait (callback, ms) {
  return new Promise(resolve => {
    setTimeout(() => resolve(callback()), ms || 0)
  })
}
function wait ( callback , ms ) { return new Promise ( resolve => { setTimeout ( ( ) => resolve ( callback ( ) ) , ms || 0 ) } ) }
Wait a specific time before executing a callback
Wait a specific time before executing a callback