Skip to content

Commit

Permalink
[javascript/en] Added setInterval
Browse files Browse the repository at this point in the history
Added the setInterval function provided by most browsers
  • Loading branch information
xssc committed Oct 19, 2015
1 parent 9702bca commit 3835cd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascript.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ setTimeout(myFunction, 5000);
// Note: setTimeout isn't part of the JS language, but is provided by browsers
// and Node.js.

// Another function provided by browsers is setInterval
function myFunction(){
// this code will be called every 5 seconds
}
setInterval(myFunction(), 5000);

// Function objects don't even have to be declared with a name - you can write
// an anonymous function definition directly into the arguments of another.
setTimeout(function(){
Expand Down

0 comments on commit 3835cd2

Please sign in to comment.