en.javascript.info/1-js/7-js-misc/3-setTimeout-setInterval/1-output-numbers-100ms/solution.md
2015-01-14 10:23:45 +03:00

17 lines
231 B
Markdown

```js
//+ run
function printNumbersInterval() {
var i = 1;
var timerId = setInterval(function() {
console.log(i);
if (i == 20) clearInterval(timerId);
i++;
}, 100);
}
// вызов
printNumbersInterval();
```