How to push object into array angular 8

i am getting below example data in this.selectedParameterContext.

Answer

Please try the below code.

deleteAllContextData(data) {
const newSelectedParameterContext = {
  'records': []
};   
this.selectedParameterContext.records.forEach(function (record) {
  const newSelectedParameterValues = [];
  record.values.forEach(function (parameter, parameterIndex) {
    const isValid = data.data.values.find(function (item) {
      return parameter.value === item.value && parameter.label === item.label;
    });
    if (isValid) {
      newSelectedParameterValues.push(parameter);
    }
  });     
  newSelectedParameterContext.records.push({ ...record, 'values': newSelectedParameterValues });
}); 
this.selectedParameterContext = newSelectedParameterContext;

}