---
# System prepended metadata

title: Balaji Rajendran | 6+ yrs Exp

---

# Balaji Rajendran | 6+ yrs Exp
- ReactJs, Vue, Javascript.

# Question 1: Js Problem
```javascript=
const arrObj = [
    { age: 9, class: 6, name: 'A'},
    { age: 10, class: 5, name: 'B'},
    { age: 11, class: 6, name: 'C'},
    { age: 10, class: 5, name: 'D'},
    { age: 12, class: 6, name: 'E'},
    { age: 10, class: 5, name: 'F'},
    { age: 12, class: 7, name: 'G'},
]
function transform(arr){
    // return arr.reduce(function(map,obj){
    //     map[obj.class] = map[obj.age].push(obj.name) 
    // })
    let map={}
    arr.forEach(obj=>{
        map[obj.age].push(obj.name)
    })
}

transform(arrObj);

// const result = {
//     5: {
//         10: ['B', 'D', 'F']
//     },
//     6: {
//         9: ['A'],
//         11: ['C'],
//         12: ['E']
//     },
//     7: {
//         12: ['G']
//     }
// }








```