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 trial

JavaScript JavaScript Foundations Arrays Creating Arrays

as I add a boolean value in the array??

this challengue say this

Set the 'mixture' variable to an array with 3 string elements, 2 numbers and one boolean.

this is my answer

var mixture = ['a string', 'manchas', 'a sub array', 3, 9]

but i not added the boolean value, as I add a boolean value in the array, can you help my please

arrays.js
var mixture;
var guides;

3 Answers

Ben Spears
Ben Spears
19,148 Points

A boolean value would be something like true, or false. To add it to the array, make sure you do not put quotes around it.

like this:

var mixture = ['a string', 'manchas', 'a sub array', 3, 9, true]

Grant G
Grant G
19,934 Points

There ar only two boolean values true or false, just add one of them to your array. Like this:

var mixture = ['a string', 'manchas', 'a sub array', 3, 9, true]

hello ,

boolean can only be true or false

var mixture = ['a string', 'manchas', 'a sub array', 3, 9,true]

hope this will help