File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
1-js/05-data-types/07-map-set/03-iterable-keys Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11
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 .
33
4- We can convert it into an array using ` Array.from ` :
4+ Îl putem converti într-un array folosind ` Array.from ` :
55
66
77``` js run
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ importance: 5
22
33---
44
5- # Iterable keys
5+ # Chei iterabile
66
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 ` .
88
9- But that doesn't work :
9+ Dar acest lucru nu funcționează :
1010
1111``` js run
1212let map = new Map ();
@@ -16,9 +16,9 @@ map.set("name", "John");
1616let keys = map .keys ();
1717
1818* ! *
19- // Error : keys.push is not a function
19+ // Eroare : keys.push nu este o funcție
2020keys .push (" more" );
2121*/ ! *
2222```
2323
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