@@ -137,14 +137,15 @@ Asta conduce la o utilizate mai interesantă spre deosebire de un boolean clasic
137137 Uneori, oeamni folosesc această funcție pentru a executa comenzi doar dacă condiția din partea stângă este efectiv falsă.
138138## && (ȘI )
139139
140- Operatorul ȘI este representat de două semne de tip ampersand ` &&` :
141- <!-- Aici am rămas -->
140+ Operatorul ȘI este reprezentat de două semne de tip ampersand ` &&` :
142141
143142` ` ` js
144143result = a && b;
145144` ` `
146145
147- In classical programming, AND returns ` true` if both operands are truthy and ` false` otherwise:
146+ <!-- P ână aici trebuie înlocuit true , truthy, false , falsey. -->
147+
148+ În programarea clasică, operatorul ȘI are ca rezultat ` true` dacă ambii operanți sunt truthy și ` false` în caz contrar:
148149
149150` ` ` js run
150151alert( true && true ); // true
@@ -153,41 +154,42 @@ alert( true && false ); // false
153154alert( false && false ); // false
154155` ` `
155156
156- An example with ` if` :
157+ Un exemplu cu ` if` :
157158
158159` ` ` js run
159160let hour = 12;
160161let minute = 30;
161-
162+
162163if (hour == 12 && minute == 30) {
163164 alert( 'The time is 12:30' );
164165}
165166` ` `
166167
167- Just as with OR , any value is allowed as an operand of AND :
168+ La fel cum se întâmplă cu operatorul ORI , orice valoare poate fi acceptată ca fiind operantul lui Ș I :
168169
169170` ` ` js run
170- if (1 && 0) { // evaluated as true && false
171- alert( "won't work, because the result is falsy" );
171+ if (1 && 0) { // evaluat ca true && false
172+ alert( "nu va funcționa, din cauză că rezultatul este falsy" );
172173}
173174` ` `
174175
176+ ## ȘI " &&" identifică prima valoare falsy
175177
176- ## AND " &&" finds the first falsy value
177-
178- Given multiple AND ' ed values:
178+ Sunt date mai multe valori conectate prin operatorul logic ȘI :
179179
180180` ` ` js
181181result = value1 && value2 && value3;
182182` ` `
183183
184- The AND `&&` operator does the following :
184+ Operatorul Ș I ` &&` face următoarele lucruri :
185185
186- - Evaluates operands from left to right .
187- - For each operand, converts it to a boolean. If the result is `false`, stops and returns the original value of that operand .
188- - If all operands have been evaluated (i.e. all were truthy), returns the last operand .
186+ - Evaluează operanții de la stânga la dreapta .
187+ - Convertește fiecare operant într - un boolean . Dac ă rezultatul este ` false` , procesul este oprit, iar valoarea originală a operantului este returnată .
188+ - Dacă toți operanții au fost evaluaț i (și toți sunt truthy), ultimul operant este returnat .
189189
190- In other words, AND returns the first falsy value or the last value if none were found.
190+ <!-- In other words, AND returns the first falsy value or the last value if none were found. -->
191+ Cu alte cuvinte, operatorul ȘI are ca rezultat prima valoare falsy sau ultima valoare dacă nicuna nu este găsită.
192+ <!-- Mai verifică încă odată propoziția de mai sus . Aici am rămas -->
191193
192194The rules above are similar to OR . The difference is that AND returns the first * falsy* value while OR returns the first * truthy* one.
193195
0 commit comments