1var select =[2,5,8];
2var filerdata=[];
3for (var i = 0; i < select.length; i++) {
4 filerdata.push(this.state.data.find((record) => record.id == select[i]));
5}
6//I have a data which is object,
7//find method return me the filter data which are objects
8//now with the push method I can make array of objects
1var studentList = ['Jason', 'Samantha', 'Alice', 'Joseph'];
2
3//Add a new student to the end of the student list
4studentList.push('Jacob');
5//list is updated to ['Jason', 'Samantha', 'Alice', 'Joseph', 'Jacob'];