---
# System prepended metadata

title: Yuvraj Das

---

# Yuvraj Das

- Language - java
- React, js, MySQL, mongodb(basic)

# Question 1: Javascript
```javascript=
const arrObj = [
    { age: 10, name: 'A', class: 5},
    { age: 12, name: 'B', class: 5},
    { age: 10, name: 'C', class: 5},
    { age: 12, name: 'D', class: 6},
    { age: 11, name: 'E', class: 6},
    { age: 12, name: 'F', class: 6}
]
// print all students names in class 5.

function getStudentsName(arrObj){
    arrObj.filter((elemennt)=>{
         if(element.class === 5){
             return (element.name);
         }
    })
}

getStudentsName(arrObj);


function getStudentsName(arrObj) {
    let arr = [];
    arrObj.filter((elemennt) => {
        if (elemennt.class === 5) {
            arr.push(elemennt.name);
        }
    })
    return arr;
}

const arrObj = [
    { age: 10, name: 'A', class: 5 },
    { age: 12, name: 'B', class: 5 },
    { age: 10, name: 'C', class: 5 },
    { age: 12, name: 'D', class: 6 },
    { age: 11, name: 'E', class: 6 },
    { age: 12, name: 'F', class: 7 }
]
console.log(getStudentsName(arrObj));



// {
//     5: ['A', 'B', 'C'],
//     6: ['D', 'E'],
//     7: ['F']
// }

getclassLenght(arrObj){
    let classarr = []
    arrObj.map((element)=>{
        classarr.push(element.class);
    })
    classarr.sort((a,b)=>{
        return (a-b);
    })
    return classarr;
    
}
function printClassStudentName(arrObj){
    let result = {};
    let classlenght = getclassLenght();
    arrObj.filter((element)=>{
        let val = [];
        if(element.class ===  classarr[element.name] ){
            result[val] = element.name;
        } 
    })
    return result;
}












```