Use an Array to Store a Collection of Data

Use an Array to Store a Collection of Data
0

#1

Tell us what’s happening:
Guys,

I’m not sure why my code does not work.

Console returns:

// running test
yourArray contains at least one boolean
yourArray contains at least one number
yourArray contains at least one string

My code however does include boolean, number and strings.

I’d appreciate your help (-:
Your code so far


let yourArray; // change this line
yourArray = [{Model: "Ford"},{Type: "Coupe"},{Colour: "blue"},{Mileage: 4},{Damaged: true}];

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data


#2

All five elements yourArray is an Object data type. You need to add a String element, a Number element and a Boolean element.

Remember a literal object has either no properties (an empty object) OR it can have one or more property/value pairs. The following is an object with a single property named propName and it has a value of propValue.

{ propName: propValue }

#3

Many thanks Randell!

let yourArray = [“Ford”, true, 5, “Great”, 6];