Use Bracket Notation

Tell us what’s happening:
Describe your issue in detail here.
I’ve watched the video on this countless times, and I just can’t seem to get this right. If somebody can identify the problem please reach out.

Your code so far


// Setup
var lastName = "Lovelace";

// Only change code below this line
var lastLetterOfLastName = lastName[lastName.length- 1]; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36

Challenge: Use Bracket Notation to Find the Last Character in a String

Link to the challenge:

The code you have shared works on my end. Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

This is not correct at all.

I know the solution to this challenge. Separately declaring the variable before setting it to the last letter in the name is absolutely not required.

I just ran the exact code in the first post and it passed fine.

forgive me… I am wrong.

I was using the wrong challenge… totally wrong! I’m sorry.

No big deal, mistakes happen to everyone

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.