Skip to content

Commit 986cf62

Browse files
closes #151 from Alexandra2888/Variables
translated
2 parents 50f47cf + 14c9aa4 commit 986cf62

File tree

9 files changed

+163
-160
lines changed

9 files changed

+163
-160
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
In the code below, each line corresponds to the item in the task list.
1+
În codul de mai jos, fiecare linie corespunde cu articolul din lista de sarcini.
22

33
```js run
4-
let admin, name; // can declare two variables at once
4+
let admin, name; // putem declara două variabile deodată
55

66
name = "John";
77

@@ -10,3 +10,4 @@ admin = name;
1010
alert( admin ); // "John"
1111
```
1212

13+

1-js/02-first-steps/04-variables/1-hello-variables/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 2
22

33
---
44

5-
# Working with variables
5+
# Lucrând cu variabile
66

7-
1. Declare two variables: `admin` and `name`.
8-
2. Assign the value `"John"` to `name`.
9-
3. Copy the value from `name` to `admin`.
10-
4. Show the value of `admin` using `alert` (must output "John").
7+
1. Declară două variabile: `admin` și `name`.
8+
2. Atribuie valoarea `"John"` la `name`.
9+
3. Copiază valoarea de la `name` la `admin`.
10+
4. Arată valoarea lui `admin` folosind `alert` (trebuie să iasă "John").
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## The variable for our planet
1+
## Variabila pentru planeta noastră
22

3-
That's simple:
3+
Este simplu:
44

55
```js
6-
let ourPlanetName = "Earth";
6+
let ourPlanetName = "Pământ";
77
```
88

9-
Note, we could use a shorter name `planet`, but it might not be obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
9+
Notează, am putea folosi un nume mai scurt decât `planet`, dar s-ar putea să nu fie evident la ce planetă se referă. E frumos să fim mai verbali. Cel puțin până când variabila nuEstePreaLungă.
1010

11-
## The name of the current visitor
11+
## Numele vizitatorului curent
1212

1313
```js
1414
let currentUserName = "John";
1515
```
1616

17-
Again, we could shorten that to `userName` if we know for sure that the user is current.
17+
Din nou, am putea scurta acest `userName` dacă știm sigur că acest utilizator este unul curent.
1818

19-
Modern editors and autocomplete make long variable names easy to write. Don't save on them. A name with 3 words in it is fine.
19+
Editoarele moderne și autocompletarea fac numele lungi de variabile ușor de scris. Nu economisi la ele. Un nume care conține trei cuvinte este în regulă.
2020

21-
And if your editor does not have proper autocompletion, get [a new one](/code-editors).
21+
Și dacă editorul tău nu are autocompletare corectă, ia [unul nou](/code-editors).

1-js/02-first-steps/04-variables/2-declare-variables/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ importance: 3
22

33
---
44

5-
# Giving the right name
5+
# Dând numele corect
66

7-
1. Create a variable with the name of our planet. How would you name such a variable?
8-
2. Create a variable to store the name of a current visitor to a website. How would you name that variable?
7+
1. Crează o variabilă cu numele planetei noastre. Cum ai numi o astfel de variabilă?
8+
2. Crează o variabilă care să stocheze numele unui vizitator curent al unui website. Cum ai numi o astfel de variabilă?
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code.
1+
În general folosim majuscule pentru constante care sunt "hard-coded". Sau, în alte cuvinte, când valoarea este știută înainte de execuție și este scrisă direct în cod.
22

3-
In this code, `birthday` is exactly like that. So we could use the upper case for it.
3+
În acest cod, `birthday` este exact la fel. Deci am putea folosi majuscule pentru el.
44

5-
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than `birthday`: it is calculated, so we should keep the lower case for it.
5+
În contrast, `age` evaluat în timpul execuției. Astăzi avem o vârstă, peste un an vom avea alta. Este constantă în sensul că nu se schimbă pe parcursul execuției codului. Dar este un pic "mai puțin constantă" decât `birthday`: este calculată, deci ar trebui să păstrăm minuscule pentru aceasta.

1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ importance: 4
22

33
---
44

5-
# Uppercase const?
5+
# Const cu majuscule?
66

7-
Examine the following code:
7+
Examinează următorul cod:
88

99
```js
1010
const birthday = '18.04.1982';
1111

1212
const age = someCode(birthday);
1313
```
1414

15-
Here we have a constant `birthday` date and the `age` is calculated from `birthday` with the help of some code (it is not provided for shortness, and because details don't matter here).
15+
Aici avem o constantă `birthday` pentru dată, și de asemenea constanta `age`.
1616

17-
Would it be right to use upper case for `birthday`? For `age`? Or even for both?
17+
`age` este calculată din `birthday` folosind `someCode()`, ceea ce înseamnă un apel de funcție pe care nu l-am explicat încă (o vom face în curând!), dar detaliile nu contează aici, ideea este că `age` este calculată cumva pe baza `birthday`.
18+
19+
Ar fi corect să folosim majuscule pentru `birthday`? Pentru `age`? Sau chiar pentru ambele?
1820

1921
```js
20-
const BIRTHDAY = '18.04.1982'; // make uppercase?
22+
const BIRTHDAY = '18.04.1982'; // facem BIRTHDAY cu majuscule?
2123

22-
const AGE = someCode(BIRTHDAY); // make uppercase?
24+
const AGE = someCode(BIRTHDAY); // facem AGE cu majuscule?
2325
```
2426

0 commit comments

Comments
 (0)