Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
junon
· 5y ago · 0 comments
const sleep = ms => new Promise(r => setTimeout(r, ms));
It doesn't need to be that tricky.
Comments
[–]
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.