setIntervalã¯ãç»é²ããcallbacké¢æ°ã®thisããããããªã£ãããcallbacké¢æ°ã«å¤ã渡ãã®ãé¢åèãã£ãã(å¤ã渡ãã«ã¯setIntervalã®ç¬¬ä¸å¼æ°ã使ãã°ãããã©ãããã ã¨å¼æ°ãåºå®ããã¡ãã)ãã¿ã¤ãã¼ã®idããsetIntervalã®æ»ãå¤ã«ãã渡ãããªããããcallbacké¢æ°å
ã§clearIntervalããããã«ã¯å¤æ°ã«ä¿æããªãããããªãã£ãããå°ãä¸ä¾¿ã var timer = { loop: function(fn, ms, v) { var self = this, id = null; return id = setInterval(function(n) { v = fn.call(self, v, id, n); }, ms); }, one: function(fn, ms, v) { var self = this, id =
{{#tags}}- {{label}}
{{/tags}}