Add Array to string

What am I doing wrong I want to add an Array to a string, but the alert won’t write the array?


var placestosee = ['newyork','people','laundry','stores'];
alert('One place to see is the'+'placestosee[2]'+);

Don’t put the array element in quotes. You should also remove the + add the end, as it’s invalid (comparable to me asking you “How much is 2 +” without ever finishing that sentence)


alert('One place to see is the' + placestosee[2]);

Ahh, I see thank you. What about a space between the string and the array, currently the words are formed together.

Just put in an extra space in the string right between the and ' :slight_smile:

Thanx, believe it or not that last problem was bothering me I couldn’t figure it out. :slight_smile: