Prompt
Write a sleep function in JavaScript that pauses code execution for a given number of milliseconds. The function should return a Promise that resolves after the specified delay.
JavaScript is a single-threaded, non-blocking language, which means it doesn't have a built-in sleep function like some other languages do. However, there are ways to emulate the same behavior.