Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Examine the supplied ( ch 0 8 - proj 0 3 . html ) file. It provides the markup for a sample company contained within
Examine the supplied chprojhtml file. It provides the markup for a
sample company contained within a card ie the rectangular box You are
going to eventually dynamically generate the card markup. If you follow the
same structure as the sample, the supplied CSS will style it similar to that
shown in Figure
You have been supplied with a JSON file named companies.json. Convert this
file into an array of company objects using JSON.parse.
Create a constructor function see Section named CompanyCard which
will be passed a company object from the JSON data. Within the constuctor
function, create properties named symbol, name, day day revenue,
marketCap marketCap equity, and tags, whose values are extracted
from the passed company object.
Add a method to CompanyCard named currency using arrow syntax that is
passed a number named num and returns a currency formatted number using
the Intl.NumberFormat function lookup the details online Add another
method to CompanyCard named billions using arrow syntax that is passed
a number named num and returns a currency using compact notation, also
using the Intl.NumberFormat function. This will display the large number in
the data set as a short billions or millions value.
Add a method to CompanyCard named outputCard that uses the methods
and properties created in the two previous steps to output the markup for a
single company card.
Create a function named outputCompanyCards that loops through the
company data, instantiate a CompanyCard object using the new keyword, and
then call the outputCard method of the CompanyCard object.
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