Pattern: Use of object rest/spread
Issue: -
Object rest/spread syntax should be avoided when targeting environments that don't support this feature. Use alternative methods like Object.assign
for object spreading and manual property assignments for rest properties.
Example of incorrect code:
const obj = { ...source };
const { a, ...rest } = data;
let newObj = { x, y, ...z };
Example of correct code:
const obj = Object.assign({}, source);
const a = data.a;
const rest = Object.assign({}, data);
delete rest.a;