Question: In this short assignment, you will create a small JSON object in JavaScript to become more familiar with the notation. Create a standard directory called

In this short assignment, you will create a small JSON object in JavaScript to become more familiar with the notation.

Create a standard directory called jsonpractice with the standard three sub-directories: images, styles, and scripts.

Create a file called jsonpractice.html in the root directory, and a file called scripts.js in the scripts sub-directory.

Define a const string at the top of your JavaScript file. This string should be a JSON list of at least 3 objects of your choosing, with each containing 2 primitive data fields and a nested object with at least 2 more fields.

The jsonpractice.html file includes the basic HTML structure including the metadata and a body with an element for you to reference in your JS code.

Link your scripts.js to your HTML and then write the necessary JS code to parse the JSON object you've written and write it onto the page.

The top-level primitive fields in each object should be shown as a heading and subheadings with the data contained in the nested objects shown as an unordered list below them.

For example...

Mercedes Benz

Germany

  • A-Class
  • C-Class
  • SLC Roadster
  • GLC Coupe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!