Already defined variable

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

Your code so far

// Only change code below this line
var a;
var b;
var c;
// Only change code above this line

a = a + 1;
b = b + 5;
c = c + " String!";

var a = 5 + 1;
var b = 10 + 5;
var c = "I am a";

Your browser information:

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

Challenge: Understanding Uninitialized Variables

Link to the challenge:

Hi there,
As the comments point out, you should only change code the top area, where you should initialize the declared variables as instructed in the challenge.

Hope that helps!

Thanks a lot Alirezaghey, so what you mean is l make the changes to the first line of code?

  1. Assign values to the variables declared in between those comments. Right now, they are undefined.
  2. Initialize these variables with values that are mentioned on the challenge.

Yes Modiise,

Yes, make the changes to the first three lines of code between the two comments. I write it out here to make sure it’s clear:

// Only change code below this line
var a;
var b;
var c;
// Only change code above this line

Also, keep in mind that this style of challenges is common in FCC where they comment the part of code you are supposed to change.

Hope that helps.

Done l passed the challenge. my biggest problem has always been understanding where to make changes in my code. Thanks though

It helps and l have gone through the challenge. Thanks, l find myself struggling a bit because l used to practice code on VSC so the transition here is different. But you Sir.

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