Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
junon
5y ago
0 comments
Save
Share
const sleep = ms => new Promise(r => setTimeout(r, ms));
It doesn't need to be that tricky.
0 comments
1 comments · 1 top-level
top
newest
oldest
eloff
5y ago
I get that the arrow function notation is less verbose, but I disagree with calling function syntax "tricky". It really doesn't matter much. You need the type on ms though (if using typescript), and export.
j
/
k
navigate · click thread line to collapse