setInterval parameters

by jacobwsmith

JavaScript

console.clear();

(function() {
  var a = 0;
  var b = 'Test'
  var count = 0;

  // https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval
  var fp = setInterval(function(a, b) {
    console.log('checking: ', a, b, count);
    if (count >= 5) {
      clearInterval(fp);
    }
    count = count + 1;
  //}(a, b), 100); // does not work :(
  //}.bind(null, a, b), 100); // this works :)
   }, 100, a, b); // this works :) 
}())