Skip to content

Instantly share code, notes, and snippets.

View jakubriedl's full-sized avatar

Jakub Riedl jakubriedl

View GitHub Profile
@jakubriedl
jakubriedl / 1asyncawait.js
Last active March 30, 2022 02:45 — forked from phuctm97/1asyncawait.js
Use Go Channels as Promises and Async/Await
// Javascript.
const one = async () => {
// Simulate a workload.
sleep(Math.floor(Math.random() * Math.floor(2000)))
return 1
}
const two = async () => {
// Simulate a workload.