My console.log of Array won't work


var junk = ["D","P",3,4];

I'm supposed to just print the array "junk"

The error has been: SyntaxError: Unterminated template literal


Works fine for me. Where are you trying to run this piece of code?

BTW you have forgotten the semi-colon after console.log. Try it.


"Make your own array called junk. Put 4 bits of data in it (first 2 strings, then 2 numbers).

Declare it using var.
Put [ ] around your data.
Separate each bit of data with a comma.
End it with a semi-colon.
Use console.log to print out junk."
the instructions


console.log will work with / without semi-colon in browsers. But, in CodeCademy, it may be
necessary. Because they match your code to the expected code.

For example, if you go for jQuery course, you may find lots of errors if you use “ instead of ‘

Try to check rest of the code, you may be missing something in there. This piece of code looks fine to me.


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