The assignment isn't reading the boolean

Tell us what’s happening:
Describe your issue in detail here.

yourArray should be an array.
yourArray should be at least 5 elements long.
yourArray should contain at least one boolean .
yourArray should contain at least one number .
yourArray should contain at least one string .

I’m not understanding how the website is saying that there’s no boolean, string, or numbers. I checked my work with the if…else and the .length just to make sure I was on track. Any help would be much appreciated!
Your code so far


let yourArray = [{a: false},{j: 2},{r : 'Yellow'},{red: 'red'},{john : 'Big J'}];


console.log(yourArray.length);
if (yourArray === true) {
console.log('true')
} else {
console.log('false')
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Challenge: Use an Array to Store a Collection of Data

Link to the challenge:

Hello @penncreative

Every element in yourArray is an object and the challenge is expecting a boolean, a string, and a number. Try inserting a boolean, a string, or a number value outside the object.

3 Likes

Thank you! That was it!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.