I need to make a delay or sleep to full pause the code
I this:
setTimeout(() => {
console.log("Hello")
}, 2000)
console.log("World")
But the log "World" prints first
Previously I'm using python and I used a code:
print("Hello")
time.sleep(2000)
print("World")
It's a success the word "Hello" prints first before world because of the time.sleep()
but I'm searching javascript code
If there's a code for it please share