Skip to content

JSL.loop()

joesimmons edited this page Sep 25, 2013 · 2 revisions

Calls a function a specified number of times.




Syntax: JSL.loop( maxIterations, fn );


Parameters:

  • maxIterations: [number] The number of times to call the function.
  • fn: A function.

Example:

// declare a function
var myFunc = function () {
    alert('Hello!');
};

// call 'myFunc' three times
JSL.loop(3, myFunc);
Clone this wiki locally