how to add objects in array in javascript

JavaScript
var a=[], b={};
a.push(b);    
// a[0] === b;let obj = { name: 'Bob' };
let arr = [{ name: 'John' }];

// add obj to array
arr = [...arr, obj];

console.log(arr) // [{ name: 'Bob' }, { name: 'John' }];var studentList = ['Jason', 'Samantha', 'Alice', 'Joseph'];

//Add a new student to the end of the student list
studentList.push('Jacob');
Source

Also in JavaScript: