File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
1-js/05-data-types/03-string Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -174,32 +174,32 @@ for (let char of "Hello") {
174
174
}
175
175
```
176
176
177
- ## Strings are immutable
177
+ ## Łańcuchy są niezmienne
178
178
179
- Strings can't be changed in JavaScript. It is impossible to change a character .
179
+ Treść łańcucha w JavaScript nie może być zmieniona. Nie można wziąć znaku ze środka ciągu i zastąpić go innym .
180
180
181
- Let's try it to show that it doesn't work :
181
+ Spróbujmy i zobaczmy, czy to nie działa :
182
182
183
183
``` js run
184
184
let str = ' Hi' ;
185
185
186
186
str[0 ] = ' h' ; // error
187
- alert ( str[0 ] ); // doesn't work
187
+ alert ( str[0 ] ); // nie działa
188
188
```
189
189
190
- The usual workaround is to create a whole new string and assign it to ` str ` instead of the old one .
190
+ Powszechnym obejściem tego problemu jest utworzenie zupełnie nowego łańcucha i przypisanie go do ` str ` zamiast starego .
191
191
192
- For instance :
192
+ Na przykład :
193
193
194
194
``` js run
195
195
let str = ' Hi' ;
196
196
197
- str = ' h' + str[1 ]; // replace the string
197
+ str = ' h' + str[1 ]; // zamieniamy ciąg
198
198
199
199
alert ( str ); // hi
200
200
```
201
201
202
- In the following sections we'll see more examples of this .
202
+ Więcej przykładów zobaczymy w kolejnych sekcjach .
203
203
204
204
## Changing the case
205
205
You can’t perform that action at this time.
0 commit comments