Ask coding questions

← Back to all posts
1
Why is this wrong ?
bananakinq (2)

// Exercise Two: Create a variable called 'cars',
// assign it to an array containing the names of three cars.
let cars = [Tesla, Nissan, Toyota];

console.log(cars);

Commentshotnewtop
1
Mosrod (253)

Please edit your post to include a meaningful title that describes your issue.

1
mwilki7 (101)

put each element in quotes

2
Edgod (47)

@bananakinq When you forget to put quotes around each element, Javascript will treat each element as a variable instead of a string.