Last active
February 6, 2019 17:10
-
-
Save Chuloo/e53b9e8963170a4212278361adbec150 to your computer and use it in GitHub Desktop.
Test array of objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array of students | |
const students = [{name: 'John', score: 50} , {name: 'Peter', score: 60}, {name: 'James', score: 55}]; | |
// Threshold Score | |
const passScore = 50; | |
// Test students | |
const studentsPassed = students.every(student => student.score >= passScore); | |
// Display status | |
console.log(studentsPassed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment