Need to know the mistake im doing in this HW problem

// Exercise One: Create a variable called ‘numbersArray’,
// assign it to an array containing 5 numbers (any numbers).

const numbersArray = [‘1’,‘2’,‘3’,‘4’,‘5’]

You have an array of strings containing numbers instead of an array of numbers.

1 Like

well how should it look like then? cuase I feel like im missing something on my notes then

const stringVariable = 'I am a string';
const numberVariable = 5;

Does this example help?

2 Likes

Hows that one different to this one that I got correct?

// Exercise Two: Create a variable called ‘cars’,
// assign it to an array containing the names of three cars.
var cars = [‘toyota’, ‘dodge’, ‘kia’]

Single quotes aren’t required around every array element unless the array elements are strings. In that exercise you made an array of strings so the single quotes were needed.

1 Like

ight that seemed to work, thx man :upside_down_face:

1 Like