I have an array by the name students and a student object
let students = []
let student = {
name: '',
rollNumber: '',
age: '',
rank: ''
}
students.concat([student])
var newStudentsArray = [...students.slice(0,index), ...students(index + 1)];
var newStudentArray = students.filter((student) => student.rank < 5)
// will return a new array of all students whose rank is less than 5
###4. Updating a value of a particular object
var newStudentArray = students.map((student) => {
if(someProperty !== student.key) return student
return Object.assign({}, student, NEW_OBJECT)
})
or in Es6
var newStudentArray = students.map((student) => {
if(someProperty !== student.key) return student
return {...student, NEW_OBJECT}
})