@@ -19,7 +19,7 @@ gets executed might block the thread, it is by **no means** a safe bet that one
1919will get the exact delay that was specified in the ` setTimeout ` call.
2020
2121The function that was passed as the first parameter will get called by the
22- * global object* , that means, that [ ` this ` ] ( #function.this ) inside the called function
22+ * global object* , which means that [ ` this ` ] ( #function.this ) inside the called function
2323refers to that very object.
2424
2525 function Foo() {
@@ -42,7 +42,7 @@ refers to that very object.
4242### Stacking Calls with ` setInterval `
4343
4444While ` setTimeout ` only runs the function once, ` setInterval ` - as the name
45- suggests - will execute the function ** every** ` X ` milliseconds. But its use is
45+ suggests - will execute the function ** every** ` X ` milliseconds, but its use is
4646discouraged.
4747
4848When code that is being executed blocks the timeout call, ` setInterval ` will
@@ -54,15 +54,15 @@ intervals, result in function calls stacking up.
5454 }
5555 setInterval(foo, 100);
5656
57- In the above code ` foo ` will get called once and will then block for one second.
57+ In the above code, ` foo ` will get called once and will then block for one second.
5858
59- While ` foo ` blocks the code ` setInterval ` will still schedule further calls to
59+ While ` foo ` blocks the code, ` setInterval ` will still schedule further calls to
6060it. Now, when ` foo ` has finished, there will already be ** ten** further calls to
6161it waiting for execution.
6262
6363### Dealing with Possible Blocking Code
6464
65- The easiest as well as most controllable solution, is to use ` setTimeout ` within
65+ The easiest solution, as well as most controllable solution, is to use ` setTimeout ` within
6666the function itself.
6767
6868 function foo(){
@@ -72,7 +72,7 @@ the function itself.
7272 foo();
7373
7474Not only does this encapsulate the ` setTimeout ` call, but it also prevents the
75- stacking of calls and it gives additional control.` foo ` itself can now decide
75+ stacking of calls and it gives additional control. ` foo ` itself can now decide
7676whether it wants to run again or not.
7777
7878### Manually Clearing Timeouts
@@ -86,7 +86,7 @@ the first place.
8686
8787### Clearing all timeouts
8888
89- As there is no built-in method for clearing all timeouts and/or intervals,
89+ Because there is no built-in method for clearing all timeouts and/or intervals,
9090it is necessary to use brute force in order to achieve this functionality.
9191
9292 // clear "all" timeouts
@@ -101,7 +101,7 @@ they can be cleared specifically.
101101### Hidden use of ` eval `
102102
103103` setTimeout ` and ` setInterval ` can also take a string as their first parameter.
104- This feature should ** never** be used, since it internally makes use of ` eval ` .
104+ This feature should ** never** be used because it internally makes use of ` eval ` .
105105
106106> ** Note:** Since the timeout functions are ** not** specified by the ECMAScript
107107> standard, the exact workings when a string is passed to them might differ in
@@ -148,7 +148,7 @@ function that will get called by either of the timeout functions.
148148to be supplied to the function that gets called. An * anonymous function* should
149149be passed that then takes care of the actual call.
150150
151- Further , the use of ` setInterval ` should be avoided since its scheduler is not
151+ Furthermore , the use of ` setInterval ` should be avoided because its scheduler is not
152152blocked by executing JavaScript.
153153
154154[ 1 ] : http://en.wikipedia.org/wiki/Document_Object_Model " Document Object Model "
0 commit comments