I have a function called an unknown number of times. I need to know how many times the function has been run, so I do:
(function () { var i = 0, increment = function () { if (i === 0) { setTimeout(function () { console.log('increment was called ' + i + ' times.');
Can someone tell me if this is reliable in all browsers or is there a better template for this?
source share