Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • setInterval() method in JavaScript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 116
    Comment on it

    In javascript sometime you have to perform task repeatedly, in that case setInterval() method can be handy to use.

    Syntax:-

    setInterval(function,time_in_milliseconds,param);

    setInterval accept time in millisecond,

    let try an example:-

    setInterval(function(){ myFunction(); }, 3000);
    
    function myFunction(){
    alert("Alert in every 3 second!");
    }
    

    So here with the help of setInterval() we are calling myFunction() function in every 3 second.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: