--- id: bd7123c9c451eddfaeb5bdef title: Use Bracket Notation to Find the Last Character in a String challengeType: 1 videoUrl: '' localeTitle: Использовать обозначение скобки для поиска последнего символа в строке --- ## Description
Чтобы получить последнюю букву строки, вы можете вычесть ее из длины строки. Например, если var firstName = "Charles" , вы можете получить значение последней буквы строки, используя firstName[firstName.length - 1] .
## Instructions
Используйте нотацию в виде скобок, чтобы найти последний символ в переменной lastName . намек
Попробуйте просмотреть lastLetterOfFirstName переменной lastLetterOfFirstName если вы застряли.
## Tests
```yml tests: - text: lastLetterOfLastName должен быть «e». testString: 'assert(lastLetterOfLastName === "e", "lastLetterOfLastName should be "e".");' - text: Вы должны использовать .length для получения последней буквы. testString: 'assert(code.match(/\.length/g).length === 2, "You have to use .length to get the last letter.");' ```
## Challenge Seed
```js // Example var firstName = "Ada"; var lastLetterOfFirstName = firstName[firstName.length - 1]; // Setup var lastName = "Lovelace"; // Only change code below this line. var lastLetterOfLastName = lastName; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```