Something wrong with JS Basics challenge

Tell us what’s happening:
Describe your issue in detail here.

I was reviewing basic JS challenges and the tests are not passing. Please check this.

Your code so far


// Setup
var lastNameLength = 0;
var lastName = "Lovelace";

// Only change code below this line

lastNameLength = lastName.length;

Your browser information:

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

Challenge: Find the Length of a String

Link to the challenge:

This test is not passing " You should not change the variable declarations in the // Setup section.". I am not changing setup, It doesn’t even works with resetting the code.

The code that you shared has the setup changed:
This is the way it originally was:

// Setup
let lastNameLength = 0;
const lastName = "Lovelace";

This is what you have:

// Setup
var lastNameLength = 0;
var lastName = "Lovelace";
1 Like

Thanks! Nobody told me :sweat_smile::joy:

The freeCodeCamp challenge told you.

You should not change the variable declarations in the // Setup section.

:neutral_face:I swear I didn’t changed setup

I guess maybe It was a bug or something which gave me the old setup containing var when I was resetting the code. Now it’s giving let and const. Thanks for help :pray:.

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