Created
January 13, 2020 14:22
-
-
Save cesarkohl/d258328e12e6b6c96f4527c11ef0cb0b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var students = [ | |
| {name: 'adam', age: 15}, | |
| {name: 'brian', age: 18}, | |
| {name: 'charles', age: 20} | |
| ]; | |
| varLarest students = []; | |
| for (var i = 0; i <students.length; i ++) { | |
| if (students [i] age> = 18) { | |
| MajorStudents.push (students [i]); | |
| } | |
| } | |
| console.log (MajorStudents); | |
| // [{name: 'adam', age: 18}, {name: 'brian', age: 20}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment