File tree 2 files changed +7
-7
lines changed
1-js/05-data-types/07-map-set/03-iterable-keys
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
2
- That's because ` map.keys() ` returns an iterable, but not an array .
2
+ Acest lucru se datorează faptului că ` map.keys() ` returnează un iterabil, dar nu o matrice .
3
3
4
- We can convert it into an array using ` Array.from ` :
4
+ Îl putem converti într-un array folosind ` Array.from ` :
5
5
6
6
7
7
``` js run
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ importance: 5
2
2
3
3
---
4
4
5
- # Iterable keys
5
+ # Chei iterabile
6
6
7
- We'd like to get an array of ` map.keys() ` in a variable and then apply array-specific methods to it , e.g. ` .push ` .
7
+ Am dori să obținem o matrice de ` map.keys() ` într-o variabilă și apoi să aplicăm metode specifice matricei , e.g. ` .push ` .
8
8
9
- But that doesn't work :
9
+ Dar acest lucru nu funcționează :
10
10
11
11
``` js run
12
12
let map = new Map ();
@@ -16,9 +16,9 @@ map.set("name", "John");
16
16
let keys = map .keys ();
17
17
18
18
* ! *
19
- // Error : keys.push is not a function
19
+ // Eroare : keys.push nu este o funcție
20
20
keys .push (" more" );
21
21
*/ ! *
22
22
```
23
23
24
- Why? How can we fix the code to make ` keys.push ` work ?
24
+ De ce? Cum putem corecta codul să facem ca ` keys.push ` să funcționeze ?
You can’t perform that action at this time.
0 commit comments