Last active
June 21, 2018 04:42
-
-
Save mirajehossain/b9d719631f075732e2a7816479501dd7 to your computer and use it in GitHub Desktop.
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
let departments = [ | |
{ name: 'CSE', student: 7000}, | |
{ name: 'EEE', student: 2000}, | |
{ name: 'CSIT', student: 5000}, | |
{ name: 'ME', student: 4500}, | |
{ name: 'ENGLISH',student: 6000}, | |
{ name: 'BBA', student: 8000}, | |
{ name: 'LAW', student: 2500} | |
]; | |
let newDepartments = []; | |
for(let i=0; i<departments.length; i++){ | |
if(departments[i].student<=5000) | |
newDepartments.push(departments[i]); | |
} | |
console.log(newDepartments); | |
///OUTPUT: | |
[ | |
{ name: 'EEE', student: 2000}, | |
{ name: 'CSIT', student: 5000}, | |
{ name: 'ME', student: 4500}, | |
{ name: 'LAW', student: 2500} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment