Submissions will no longer be placed on the leaderboard. You may still attempt this problem for practice.

JavaScript Objects

Objects are variables too, but objects can contain many values.

For example, this code below assigns three values (Fiat, 500, white) to a variable named myObject:

var myObject = {type:"Fiat", model:500, color:"white"};

The values are written as name:value pairs. The name and value are separated by a colon. The name:values pairs (in JavaScript objects) are called properties.

Here's a useful video discussing JavaScript Objects in general:

Accessing Object Properties

You can access object properties in two ways:

objectName.propertyName

or

objectName["propertyName"]

Task

In this example, you are given a single line consisting of property type values of a car in the following order:

TypeName ModelName ColorName

These values are assigned to an object car that has the properties type, model and color (read the code in the editor carefully to learn how that is done). Your task is to complete the code to print the object.

Sample Input

Fiat 500 White

Sample Output

{ type: 'Fiat', model: '500', color: 'White' }
Line: 1 Col: 1
  1. Challenge Walkthrough
    Let's walk through this sample challenge and explore the features of the code editor.1 of 6
  2. Review the problem statement
    Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
  3. Choose a language
    Select the language you wish to use to solve this challenge.3 of 6
  4. Enter your code
    Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
  5. Test your code
    You can compile your code and test it for errors and accuracy before submitting.5 of 6
  6. Submit to see results
    When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
  1. Check your score