Destructuring issue

I tried to destructure the following array containing URLs with the array of small strings but it’s bringing up an error.

const verses = [

const ["verse 1", "verse 2", "verse 3", "verse 4"] = verses;

The error says “Uncaught SyntaxError: Invalid destructuring assignment target”. Can anyone tell me why that is? Is the syntax not correct or something?

NOTE: I’m a bit of a novice with JavaScript so forgive me if this might be an obvious problem to solve.

This is an array of strings instead of variables. You can’t assign anything to a string, only a variable.

@JeremyLT I actually tried this before and it didn’t work but then I remembered I accidentally left the spaces in so I had to type verse1 instead of verse 1. Thanks!

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