Javascript – Why doesn't the statement after await continue to execute after promise resolves?
I want to implement an asynchronous task scheduling. This is my code: let gameTick = 0; const tasks: Record<string, Function[]> = {}; function sleep(t: number) { const targetTick = gameTick + t; if (!tasks[targetTick]) { tasks[targetTick] = []; } return…