Try to search your question here, if you can't find : Ask Any Question Now ?

SetTimeout() call without callback function behaves in unexpected manner

HomeCategory: stackoverflowSetTimeout() call without callback function behaves in unexpected manner
Avatarpushpa asked 2 weeks ago

I was just experimenting with settimeout() function and in one attempt I wrote down the following code:

console.log(setTimeout('a', 1000));

When I executed this statement, I received the following output on my console:
enter image description here

I do understand that the error a is undefined appears because setTimeout() expects a function as its first argument but why do I see the numbers 379, 380 on the console. I believe this is the number of seconds elapsed since the setTimeout() command was first executed in the current session.
Am I correct about this? Could someone please explain in more detail.

1 Answers
Best Answer
Avatarnaveen answered 2 weeks ago
Your Answer

3 + 3 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com