I would like to know why my solution is wrong and the correction

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

Your code so far


// Only change code below this line
var a = 6;
var b= 15;
var c = "I am a String";

var a = 5 + 1 ;
var b = 10 + 5;
var c = "I am a String";
// Only change code above this line

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

Your browser information:

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

Challenge: Understanding Uninitialized Variables

Link to the challenge:

let dim = ;

function steamrollArray(arr){

for(let i=0; i<arr.length; i++){

if(Array.isArray(arr[i])===true){

  steamrollArray(arr[i])

}else{

  dim.push(arr[i])

}

}

return dim

}

console.log(steamrollArray([[[“a”, “b”]], [[“b”], “c”]]));

/* this program does not accept, can anybody tell what’s wrong with it? */

I would click the “Reset All Code” button to start over fresh for this challenge. You only want to initialize the variables once, so you don’t need to add any new lines, just use the existing lines that are there. The instructions tell you exactly what to initialize the variables to. So you just need to set the three existing variables to exactly what the instructions say. Don’t make this harder than it needs to be. There is nothing to think about here. Just set the three variables to the values provided in the instructions.

I would suggest staring your own thread. In the FCC curriculum, if you press the Get Help -> Ask for Help button, it will help you create one with the relevant information.

1 Like

thanks a lot Chief,
i am very grateful for your help