Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBenjamin Bonenfant
4,724 Pointswhy is the following code incorrect for this challenge task? const data = [ '1', '2', '3' ]; Thank you.
const data = [ '1', '2', '3' ];
2 Answers
Adam N
70,280 PointsThe task asks for three numbers inside the array. The type of the three items within your array are strings.
console.log(typeof '1') // string
Let me know if this helps!
volhaka
9,875 PointsThe challenge is to include three number values inside the array. Your array includes 3 strings. whatever you put into quotes - ' ' is a string numbers should be without quotes
Jonathan Hermansen
25,935 PointsJonathan Hermansen
25,935 PointsMaybe the task want's a changeable array, e.g. var or let