FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

javascripting/problems/objects/problem.md at master · fodorelli/javascripting · GitHub

Latest commit

 

History

History
32 lines (23 loc) · 594 Bytes

File metadata and controls

32 lines (23 loc) · 594 Bytes

Objects are lists of values similar to arrays, except values are identified by keys instead of integers.

Here is an example:

var foodPreferences = {
  pizza: 'yum',
  salad: 'gross'
};

The challenge:

Create a file named objects.js.

In that file, define a variable named pizza like this:

var pizza = {
  toppings: ['cheese', 'sauce', 'pepperoni'],
  crust: 'deep dish',
  serves: 2
};

Use console.log() to print the pizza object to the terminal.

Check to see if your program is correct by running this command:

javascripting verify objects.js

Back | FazBrowse Home | New Git URL