Responsive Result Summary

Solution retrospective
I learned how to display data from JSON file. For future instance, I'd like to deep further into displaying dynamic data from JSON.
What challenges did you encounter, and how did you overcome them?I had some setbacks when figuring out how to display the JSON data and setting up the gradient styling for the result card.
What specific areas of your project would you like help with?Any inputs will be appreciated.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@dar-ju
Hi Fadhil Ahmad!
In this task you had to copy data from the data.json file to a js file. It turns out to be code duplication. Here is a way to take data directly from data.json:
- include the js file as a module:
<scri-pt type="module" src="assets/script.js"></scri-pt>
(remove '-' in scri-pt)
- add a constant to data.json, that is, the first line should be
export const data = [
and rename file to data.js - in the script.js file at the top add
import { data } from "../data.js";
In this case, your logic and data are separated, which is convenient.
Good luck with your development!
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord