// Exercise One: Create a variable called ‘numbersArray’,
// assign it to an array containing 5 numbers (any numbers).
const numbersArray = [‘1’,‘2’,‘3’,‘4’,‘5’]
// 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.
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?
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.
ight that seemed to work, thx man