1
JS Assignment 9: Intro to Arrays
maximussallam (2)

// Exercise One: Create a variable called 'numbersArray',
// assign it to an array containing 5 numbers (any numbers).
const numbersArray = ['0', '1', '2', '3', '4'];

Expected 'string' to be 'number'.

Why is this wrong?

You are viewing a single comment. View All
2
malvoliothegood (90)

The quote marks around your numbers turns them into text representations of number. You need const numbersArray = [0, 1, 2, 3, 4];