Array String Write

I’d like to know why this is not writing, specifically the last line. I have the array which is fine but I can’t get the last line to write.

document.write ('<p>The First Author is <strong>');
	document.write (authors[0] + '</strong></p>');
	document.write ('<p>The last author is <strong>');
	document.write (authors[authors.length-1] + '</strong></p>');
	authors.unshift ('Stan Lee');
	document.write ('<p>I almost forgot <strong>' + authors[0] '</strong></p>');

You’re missing a plus sign between authors[0] and ‘</strong></p>’.

Odd the error console is saying I’m missing a bracket in the argument list.

document.write (‘<p>I almost forgot <strong>’ authors[0] + ‘</strong></p>’);

You’ll still need the plus sign before authors[0] too.

Ahhh right. Add the array between two strings, son of a gun.

Yep, sometimes the smallest errors (missing one character, as in this case) will mess you up. Some languages (like Ruby) allow you to concatenate strings by just putting them next to each other in an expression, but in JavaScript you need to separate each string you wish to concatenate with a plus sign.

Interesting, I don’t know what Ruby can do but I see it is a little more simpler. :slight_smile: