Here is an array of objects:
var students = [
{
name : "Mike",
track: "track-a",
points : 40,
},
{
name : "james",
track: "track-a",
points : 61,
},
]
students.forEach(myFunction);
function myFunction (item, index) {
for( var key in item ) {
console.log(item[key])
}
}
I am looking to display the strings inside a div as follows. For point values greater than 50, I will print "Passed" otherwise "Failed", followed by the name and track details like below:
Failed: Mike in track track-a
Passed: james in track track-1
How can I create a template string to achieve this output?