BYJU'S interview question

Write a function for the following JavaScript code? console.log(omit({ a: 1, b: '2', c: 3 }, ['b'])); // {“a”:1,”c”:3} console.log(omit({ a: 1, b: 2, c: 3 }, ['c'])); // {“a”:1,”b”:2}

Interview Answer

Anonymous

Sep 30, 2020

function omit(obj, arr){ for(let i=0; i