When I tell javascript to give the first value of an array, it gives the first letter

I am saving arrays to localStorage values to save the values in the arrays to an array in a different javascript file. When I tell it to give the first value of the array, it just gives the first letter of the first value. I know it is the first value because when I display the whole array to a p element, there are no commas between letters.
File setting values:

localStorage.setItem('question-names-array', questionNames)

(questionNames is an array)

File retrieving values:

questionNameDisplay.innerHTML = questionNames[0]

If the first value of questionNames is hello, questionNameDisplay.innerHTML will be ‘h’
Can anyone tell me what I am doing wrong and/or what I can do to fix it?

If it’s giving the first letter, your item is probably a string. You can set a breakpoint to check for this.

1 Like

how do I set a breakpoint?

Bit involved to explain, I’d recommend looking up videos:
This one seems decent enough

1 Like