The following prints my message straight away
setTimeout(console.log('delayed hello world'), 10000);
It’s a little bit counterintuitive. And since my message print straight away what happens at the end of 10 seconds?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to use anonymously function for that:
See more about passing params to
setTimeoutfunction at MDN