JSFiddle - React, Tailwind, and code Playground
JavaScript
var obj = {
a: true,
b: true,
c: true
};
var basic ={
arr: ['a', 'b']
}
function strip(o) {
for (var i in o) {
var test = basic.arr.some(function(x) {return x === i} );
if (test)
delete o[i];
}
return o;
}
strip(obj);
console.log(obj)