Skip to content

Commit da4a3e1

Browse files
committed
translated until line 105
1 parent f3d25ad commit da4a3e1

File tree

1 file changed

+10
-10
lines changed
  • 1-js/06-advanced-functions/08-settimeout-setinterval

1 file changed

+10
-10
lines changed

1-js/06-advanced-functions/08-settimeout-setinterval/article.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,32 @@ setTimeout(sayHi(), 1000);
7777
Asta nu va funcționa, deoarece `setTimeout` se așteaptă la o referință spre o funcție. Iar aici `sayHi()` rulează funcția, iar *rezultatul execuției sale* este trecut la `setTimeout`. În cazul nostru, rezultatul lui `sayHi()` este `undefined` (funcția nu returnează nimic), deci nu se planifică nimic.
7878
````
7979

80-
### Canceling with clearTimeout
80+
### Anulare cu clearTimeout
8181

82-
A call to `setTimeout` returns a "timer identifier" `timerId` that we can use to cancel the execution.
82+
Un apel la `setTimeout` returnează un "identificator de temporizator" `timerId` pe care îl putem folosi pentru a anula execuția.
8383

84-
The syntax to cancel:
84+
Sintaxa de anulare:
8585

8686
```js
8787
let timerId = setTimeout(...);
8888
clearTimeout(timerId);
8989
```
9090

91-
In the code below, we schedule the function and then cancel it (changed our mind). As a result, nothing happens:
91+
În codul de mai jos, planificăm funcția și apoi o anulăm (ne-am răzgândit). Ca urmare, nu se întâmplă nimic:
9292

9393
```js run no-beautify
94-
let timerId = setTimeout(() => alert("never happens"), 1000);
95-
alert(timerId); // timer identifier
94+
let timerId = setTimeout(() => alert("nu se întâmplă niciodată"), 1000);
95+
alert(timerId); // identificatorul temporizatorului
9696

9797
clearTimeout(timerId);
98-
alert(timerId); // same identifier (doesn't become null after canceling)
98+
alert(timerId); // același identificator (nu devine nul după anulare)
9999
```
100100

101-
As we can see from `alert` output, in a browser the timer identifier is a number. In other environments, this can be something else. For instance, Node.js returns a timer object with additional methods.
101+
După cum se poate observa din ieșirea `alert`, într-un browser identificatorul temporizatorului este un număr. În alte medii, acesta poate fi altceva. De exemplu, Node.js returnează un obiect timer cu metode suplimentare.
102102

103-
Again, there is no universal specification for these methods, so that's fine.
103+
Din nou, nu există o specificație universală pentru aceste metode, așa că este în regulă.
104104

105-
For browsers, timers are described in the [timers section](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers) of HTML Living Standard.
105+
Pentru browsere, temporizatoarele sunt descrise în [secțiunea timers](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers) din HTML Living Standard.
106106

107107
## setInterval
108108

0 commit comments

Comments
 (0)