Understanding how to use a Javascript object is critical for anyone who wants to further their knowledge in Javascript.
Here, given an array of javascript objects, write a function that print all the students' names and their country.
let students = [
{name: 'Remy', country: 'Korea'},
{name: 'Chuck', country: 'China'},
{name: 'Osmund', country: 'U.S.A.'},
{name: 'Nicole', country: 'South Africa'},
{name: 'Boris', country: 'France'},
{name: 'John', country: 'Philippines'},
{name: 'Michael', country: 'Ukraine'}
];<div class="preloader"><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
Your console should look exactly like the following when the function is called with the provided array.
Name: Remy, Country: Korea
Name: Chuck, Country: China
Name: Osmund, Country: U.S.A.
Name: Nicole, Country: South Africa
Name: Boris, Country: France
Name: John, Country: Philippines
Name: Michael, Country: Ukraine<div class="preloader"><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
In order to pass the test cases, your output needs to look exactly like above.
After you solve this challenge, I highly encourage you to watch the video answer to learn a few new techniques of iterating through an array and adding variable value in a string in an easier way.