Question

*Using Javascript* Create an object called contacts using the JSON DataSet. Write a function that will...

*Using Javascript*

Create an object called contacts using the JSON DataSet.
Write a function that will access the object to print "Company: companyField - Phone: phoneField" to console.log().

[
   {
       "Names": "Ross",
       "Company": "Quis Urna Nunc Company",
       "Email": "[email protected]",
       "Phone": "(855) 152-2097"
   },
   {
       "Names": "Jada",
       "Company": "Pretium Corp.",
       "Email": "[email protected]",
       "Phone": "(580) 169-1471"
   },
   {
       "Names": "Iola",
       "Company": "Duis Limited",
       "Email": "[email protected]",
       "Phone": "(649) 970-8829"
   },
   {
       "Names": "Jonas",
       "Company": "Ac Associates",
       "Email": "[email protected]",
       "Phone": "(369) 430-5709"
   },
   {
       "Names": "Norman",
       "Company": "Id Foundation",
       "Email": "[email protected]",
       "Phone": "(713) 889-8319"
   },
   {
       "Names": "Urielle",
       "Company": "Dolor Quisque Tincidunt Associates",
       "Email": "[email protected]",
       "Phone": "(383) 708-2318"
   },
   {
       "Names": "Hyatt",
       "Company": "Purus Ltd",
       "Email": "[email protected]",
       "Phone": "(723) 704-9914"
   }
]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is code:

var contacts = [
{
"Names": "Ross",
"Company": "Quis Urna Nunc Company",
"Email": "[email protected]",
"Phone": "(855) 152-2097"
},
{
"Names": "Jada",
"Company": "Pretium Corp.",
"Email": "[email protected]",
"Phone": "(580) 169-1471"
},
{
"Names": "Iola",
"Company": "Duis Limited",
"Email": "[email protected]",
"Phone": "(649) 970-8829"
},
{
"Names": "Jonas",
"Company": "Ac Associates",
"Email": "[email protected]",
"Phone": "(369) 430-5709"
},
{
"Names": "Norman",
"Company": "Id Foundation",
"Email": "[email protected]",
"Phone": "(713) 889-8319"
},
{
"Names": "Urielle",
"Company": "Dolor Quisque Tincidunt Associates",
"Email": "[email protected]",
"Phone": "(383) 708-2318"
},
{
"Names": "Hyatt",
"Company": "Purus Ltd",
"Email": "[email protected]",
"Phone": "(723) 704-9914"
}
]
function print() {
for (var i = 0 ; i < contacts.length; i++) {
console.log("Names:" + contacts[i].Names);
console.log("Company:" + contacts[i].Company);
console.log("Email:" + contacts[i].Email);
console.log("Phone:" + contacts[i].Phone);
}
}

Output:

Names: Ross Company:Quis Urna Nunc Company Email:amet.orci@sagittisDuisgravida.com Phone: (855) 152-2097 Names:Jada Company:

Add a comment
Know the answer?
Add Answer to:
*Using Javascript* Create an object called contacts using the JSON DataSet. Write a function that will...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT