Skip to content

Commit 6ae22e7

Browse files
string#strings-are-immutable
1 parent adcfca6 commit 6ae22e7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

1-js/05-data-types/03-string/article.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,32 +174,32 @@ for (let char of "Hello") {
174174
}
175175
```
176176

177-
## Strings are immutable
177+
## Łańcuchy są niezmienne
178178

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.
180180

181-
Let's try it to show that it doesn't work:
181+
Spróbujmy i zobaczmy, czy to nie działa:
182182

183183
```js run
184184
let str = 'Hi';
185185

186186
str[0] = 'h'; // error
187-
alert( str[0] ); // doesn't work
187+
alert( str[0] ); // nie działa
188188
```
189189

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.
191191

192-
For instance:
192+
Na przykład:
193193

194194
```js run
195195
let str = 'Hi';
196196

197-
str = 'h' + str[1]; // replace the string
197+
str = 'h' + str[1]; // zamieniamy ciąg
198198

199199
alert( str ); // hi
200200
```
201201

202-
In the following sections we'll see more examples of this.
202+
Więcej przykładów zobaczymy w kolejnych sekcjach.
203203

204204
## Changing the case
205205

0 commit comments

Comments
 (0)