You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
286 B

export function dissoc(prop, obj){
if (arguments.length === 1) return _obj => dissoc(prop, _obj)
if (obj === null || obj === undefined) return {}
const willReturn = {}
for (const p in obj){
willReturn[ p ] = obj[ p ]
}
delete willReturn[ prop ]
return willReturn
}