Languages

TypeScript - what is correct version when I use setTimeout? (Node.js vs Web Browser)

8 points
Asked by:
Dexter
660

I have noticed, when I use setTimeout() function in TypeScript, it returns NodeJS.Timeout type.

On MDN we can find:

The returned value is a positive integer value which identifies the timer created by the call.

Should I use it when I write fornt-end application?

I would like to run it later in web browser.

2 answers
5 points
Answered by:
Root-ssh
178180

Writing Node.js application use:

 

Writing web browser application use:

0 commentsAdd comment
3 points
Answered by:
Xitiz
2195

Check this one solution:

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join