Need help with this JavaScript question:
Now create three new objects. Each object should have the following properties:
type
: a string specifying what type ofmysticalAnimal
this is. Unicorns and dinosaurs and yeti and Loch Ness Monsters and polar bears and red pandas are all viable options!collects
: an array with a few things this animal might collectcanFly
: a boolean (true
orfalse
— no strings around it, these are reserved keywords) representing whether this animal can fly or not.
Our small paired programming group tried:
var myArray = [];
myArray.push(myObject);
var chipotle = ['unicorn', 'food', true];
How would we properly address this? What is the correct code?