--- id: bd7123c9c452eddfaeb5bdef title: Use Bracket Notation to Find the Nth-to-Last Character in a String challengeType: 1 videoUrl: '' localeTitle: Use a notação de suporte para localizar o caractere N-para-último em uma seqüência de caracteres --- ## Description
Você pode usar o mesmo princípio que acabamos de usar para recuperar o último caractere em uma string para recuperar o caractere de enésima a última. Por exemplo, você pode obter o valor da terceira para a última letra da string var firstName = "Charles" usando firstName[firstName.length - 3]
## Instructions
Use a notação de colchetes para localizar o penúltimo caractere na string lastName . Sugestão
Tente observar a declaração da variável thirdToLastLetterOfFirstName se você ficar preso.
## Tests
```yml tests: - text: secondToLastLetterOfLastName deve ser "c". testString: 'assert(secondToLastLetterOfLastName === "c", "secondToLastLetterOfLastName should be "c".");' - text: Você tem que usar o .length para obter a segunda última letra. testString: 'assert(code.match(/\.length/g).length === 2, "You have to use .length to get the second last letter.");' ```
## Challenge Seed
```js // Example var firstName = "Ada"; var thirdToLastLetterOfFirstName = firstName[firstName.length - 3]; // Setup var lastName = "Lovelace"; // Only change code below this line var secondToLastLetterOfLastName = lastName; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```