Can somebody further understand what coroutine.yield does?

I’m looking at the coroutine page, and I see coroutine.yield. What I would think is this would yield the current coroutine, or yield the coroutine with the name for the first parameter, however, this doesn’t seem to be the case. Even after seeing the “yield” section, I don’t entirely understand what it means. Can somebody explain?

It does yield the running the coroutine, but the argument is not a thread name. It’s just a value to be returned. It stops the running code at the point of yield. You can call coroutine.resume on the coroutine to continue running it.

If it’s dead, then it can’t be resumed. It’ll die when all the code to be ran is done.