You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/07-type-conversions/article.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,37 +116,37 @@ alert( Boolean(" ") ); // spații, de asemenea true (orice șir ne-gol este true
116
116
```
117
117
````
118
118
119
-
## Summary
120
119
## Rezumat
121
120
122
-
The three most widely used type conversions are to string, to number, and to boolean.
121
+
Cele mai des folosite tipuri de conversii sunt la șir, la numere, și la boolean
123
122
124
-
**`String Conversion`** -- Occurs when we output something. Can be performed with `String(value)`. The conversion to string is usually obvious for primitive values.
123
+
**`Conversia Șirului`** -- Apare când afișăm ceva. Poate fi executată cu `String(value)`. Aceasta conversia la șir este destul de evidentă pentru pentru valori primitive.
125
124
126
-
**`Numeric Conversion`** -- Occurs in math operations. Can be performed with `Number(value)`.
125
+
**`Conversia Numerică`** -- Apare în operațiile matematica. Poate fi executată cu `Number(value)`.
127
126
128
-
The conversion follows the rules:
127
+
Conversia urmează regulile:
129
128
130
-
| Value | Becomes... |
129
+
| Valoare | Devine... |
131
130
|-------|-------------|
132
131
|`undefined`|`NaN`|
133
132
|`null`|`0`|
134
133
|<code>true / false</code> | `1 / 0` |
135
-
| `string` | The string is read "as is", whitespaces from both sides are ignored. An empty string becomes `0`. An error gives `NaN`. |
134
+
| `string` | Șirul este citit "așa cum este", spațiile goale din ambele părți sunt ignorate. Un șir gol devine `0`. O eroare devine `NaN`. |
136
135
137
-
**`Boolean Conversion`** -- Occurs in logical operations. Can be performed with `Boolean(value)`.
136
+
**`Conversia Boolean`** -- Apare in operațiile logice. Poate fi executată cu `Boolean(value)`.
138
137
139
-
Follows the rules:
138
+
Urmează regulile:
140
139
141
-
| Value | Becomes... |
140
+
| Valoare | Devine... |
142
141
|-------|-------------|
143
142
|`0`, `null`, `undefined`, `NaN`, `""` |`false`|
144
-
|any other value| `true` |
143
+
|orice altă valoare| `true` |
144
+
145
145
146
+
Majoritatea acestor reguli sunt ușor de înțeles și memorat. Excepțiile notabile unde oamenii fac greșeli de obicei sunt:
146
147
147
-
Most of these rules are easy to understand and memorize. The notable exceptions where people usually make mistakes are:
148
+
- `undefined` este `NaN` ca și număr, nu `0`.
149
+
- `"0"` și șirurile mono-spațiale ca și `" "` sunt adevărate ca și boolean.
148
150
149
-
- `undefined` is `NaN` as a number, not `0`.
150
-
- `"0"` and space-only strings like `" "` are true as a boolean.
151
+
Obiectele nu sunt acoperite aici. Ne vom întoarce la ele mai târziu in capitolul <info:object-toprimitive> ce este devotat exclusiv obiectelor dupa ce învățăm mai multe lucruri elementare despre JavaScript
151
152
152
-
Objects aren't covered here. We'll return to them later in the chapter <info:object-toprimitive> that is devoted exclusively to objects after we learn more basic things about JavaScript.
0 commit comments