Super stuck.... and getting discouraged!


#1



Hey there everyone.
So, I'm working through the Arrays section (9) and I keep getting this message saying that my first group of data is not a string. Why? It logs to the console but includes the brackets. Is it supposed to do that? Also, the first string has double brackets around it. Is that right?


var names = ["I thank God I love cheese!"];
var letters = ["I am very happy!"];
var sizes = [4,6,3,2,1,9];
var numbers = [6,5,4,3,2];
var junk = [names, letters, sizes, numbers];
console.log(junk)

I keep getting "Oops! Looks like your first element in junk isn't a string!" But, it is a string, isn't it?


#2

You should add double quotes around the strings to tell js that it is a string.

Like this:

var junk = ["names", "letters", "sizes", "numbers"];

#3

Hey there,
Thanks for this information @dutchc0de . That helped with the string problem; however, Now I am getting a numbers error. It's so confusing I don't know what to do. I should have taken the Computer Information Sciences major in college. SMH. Please help!


#4

Hey... @dutchc0de
I got it!!!
I was overthinking it completely. Too many arrays.

This is the solution code:

var junk = ["Celeste", "Sabrina", 3, 4]
console.log(junk)


#5

Congratulations on figuring it out yourself!


#6

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