Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4504059
simple_timer_await.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
470 B
Referenced Files
None
Subscribers
None
simple_timer_await.cjs
View Options
async function test() {
console.log("1: Before await");
const x = await new Promise(resolve => setTimeout(() => {
console.log("2: Timer fired");
resolve("VALUE");
}, 50));
console.log("3: After await, x =", x);
console.log("4: About to return");
return "FINAL_" + x;
}
console.log("A: Calling test()");
const p = test();
console.log("B: test() returned");
p.then(result => console.log("C: Promise resolved:", result));
console.log("D: Script end");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 9:41 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
519604
Default Alt Text
simple_timer_await.cjs (470 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment