Understanding: Declare JavaScript Objects as Variables

Understanding: Declare JavaScript Objects as Variables
0.0 0

#1

Why does this program only give me the ‘motorBike’ objects when I run it, and not the ‘car’ objects too?

Your code so far

var car = {
  "wheels":4,
  "engines":1,
  "seats":5
};

var motorBike = {
"wheels": 2, "engines": 1, "seats": 2
};

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0.

Link to the challenge:


#2

The tests are only interacting with motorBike. The car object is just there as an example.