summaryrefslogtreecommitdiffhomepage
path: root/javascript.html.markdown
diff options
context:
space:
mode:
authorSawyer Charles <xssc@users.noreply.github.com>2015-10-19 10:54:42 -0500
committerSawyer Charles <xssc@users.noreply.github.com>2015-10-19 10:54:42 -0500
commit3835cd26f5c58b05c547d2c9d51b39252e0eca15 (patch)
tree89cfb7441d25ee4724976e686f54d79bab366d1b /javascript.html.markdown
parent9702bcaf86c7a0fa004c120443cb43a6ec2d6e04 (diff)
[javascript/en] Added setInterval
Added the setInterval function provided by most browsers
Diffstat (limited to 'javascript.html.markdown')
-rw-r--r--javascript.html.markdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown
index d408e885..22a2959c 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -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(){