UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

14 lines (10 loc) 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 }