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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started