Destructuring Assignment / Task
my video on Destructring in JavaScript
A task/challenge from- Create an array of objects
- Each object should contain the data of a browser
- Store the "company", "name" and "marketShare" in variables for any random item in the array every 2 seconds
- log
"{company} developed {name} which holds {marketShare} of the Market Share"
to the console
To get other browser market shares: Browser Market Shares
Example Data:
const browsers = [
{
name: "Firefox",
company: "Mozilla",
marketShare: "8.01%",
},
{
name: "Chrome",
company: "Google",
marketShare: "68.26%",
},
{
name: "Edge",
company: "Microsoft",
marketShare: "6.67%",
},
{
name: "Opera",
company: "Opera Software",
marketShare: "1.31%",
},
];
Hint: use Math.floor(Math.random() * 4)
and store it in a variable to get a random number
Hint: use setInterval
to repeat the code