Arrays and Objects in JS Lesson 12


So, I just started writing objects and I wanted to make sure I got thorough practice right off. So, in addition to writing the objects I tried to call components of the objects. Can someone help me fix this? Thanks!

Arrays and Objects in JS Lesson 12

This is the error message I’m receiving from the console:
“ReferenceError: object is not defined”

var object1 = {
    numbers: [2, 3, 4],
    letters: ["A", "B", "C", "D", "E", "F", "G"]

var object2 = new Object();
object2.animals = ["pig", "dog", "cat", "fish", "bird"]
object2.namethem = function(){

var object3 = new Object();
object3["teams"] = ["Red Sox", "Yankees", "Cubs", "Braves"];
object3["Playoffs"] = function (){
    var team1 = object3.teams[Math.floor(Math.random()*4)-2];
    var team2 = object3.teams[Math.floor(Math.random()*2)+2];
    console.log("The two teams heading to the playoffs are "+team1 + " and " + team2 + "!");
<do not remove the three backticks above>




i think you intended to use object2, there is no object named object


Thank you!!! It worked!