Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: javascript-tutorial/uz.javascript.info
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: shohqadamm/uz.javascript.info
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 26, 2022

  1. Assalomu alaykum

    uz.javascript.info/1-js/06-advanced-functions/08-settimeout-setinterval/3-rewrite-settimeout/solution.md
    file qo'shdim va kichik tarjimani amalga oshirdim faqat javascript.info
    saytidagi original Taskni topolmadim shuning uchun javob to'griligiga
    ishinchim komil emas tekshirib qabul qiling
    shohqadamm committed Mar 26, 2022
    Copy the full SHA
    4bea0a5 View commit details
  2. Copy the full SHA
    4c284e8 View commit details
Showing with 24 additions and 0 deletions.
  1. +24 −0 1-js/06-advanced-functions/08-settimeout-setinterval/3-rewrite-settimeout/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
foydalanildi `setInterval`

```js run
let i = 0;

let start = Date.now();

function count() {

if (i == 1000000000) {
alert("Done in " + (Date.now() - start) + 'ms');
} else {
setTimeout(() => { clearInterval(count) }, 5000);
}

// a piece of heavy job
for(let j = 0; j < 1000000; j++) {
i++;
}

}

count();
```