Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4504709
promise_simple.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
967 B
Referenced Files
None
Subscribers
None
promise_simple.cjs
View Options
// Test Promise.all with resolved promises
async function test_promise_all_simple() {
console.log('Testing Promise.all with simple values...');
const promises = [
Promise.resolve(1),
Promise.resolve(2),
Promise.resolve(3)
];
const results = await Promise.all(promises);
console.log('Results:', results);
}
// Test Promise.race with resolved promises
async function test_promise_race_simple() {
console.log('Testing Promise.race...');
const promises = [
Promise.resolve('first'),
Promise.resolve('second')
];
const winner = await Promise.race(promises);
console.log('Winner:', winner);
}
// Test fetch still works
async function test_fetch() {
console.log('Testing fetch...');
const response = await fetch('https://httpbin.org/get');
console.log('Fetch status:', response.status);
}
void test_promise_all_simple();
console.log('---');
void test_promise_race_simple();
console.log('---');
void test_fetch();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 9:57 AM (3 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
518941
Default Alt Text
promise_simple.cjs (967 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment