Basic JavaScript - Use Bracket Notation to Find the Nth-to-Last Character in a String

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

// Setup
const lastName = "Lovelace";

// Only change code below this line
const secondToLastLetterOfLastName = lastName[lastName.length - 2]; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 9; vivo 1921) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36

Challenge Information:

Basic JavaScript - Use Bracket Notation to Find the Nth-to-Last Character in a String

use console.log() to see what you are returning.

console.log(secondToLastLetterOfLastName) or
console.log(lastName[lastName.length - 2])

Don’t forget to talk to us about how you are stuck. It helps us help you easier, and communication is a critical coding skill.

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