Skip to content

Commit 163f3e0

Browse files
authored
Fixes #1832
1 parent 7649089 commit 163f3e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ alert( str.at(0) ); // H
142142
143143
// получаем последний символ
144144
alert( str[str.length - 1] ); // o
145-
alert( str.at(-1) );
145+
alert( str.at(-1) ); // o
146146
```
147147

148148
Как вы можете видеть, преимущество метода `.at(pos)` заключается в том, что он допускает отрицательную позицию. Если `pos` -- отрицательное число, то отсчет ведется от конца строки.

0 commit comments

Comments
 (0)