Multiple choice technology web technology

How will you make a function to execute after 4 seconds ?

  1. setTimeout('functionname()',4)

  2. setTimeout('functionname()',4000)

  3. setTimeout('functionname()',400)

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The setTimeout function in JavaScript expects the delay time to be specified in milliseconds. Since 1 second equals 1000 milliseconds, a 4-second delay requires a value of 4000.