We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Given this JS object
const george = { name: 'George Costanza', age: 37, skills: undefined, vocation: null }
Write me a function that will return a new object (no mutation) with any null or undefined values excluded.
const newGeorge = removeNil(obj) console.log(newGeorge) // { name: 'George Costanza', age: 37 }
Add in the ability for me to include source objects, similar to the ES6 Object.assign method.
Object.assign
const art = removeNil(obj, { name: 'Art Vandelay', age: null, vocation: 'architect' }) console.log(art) // { name: 'Art Vandelay', vocation: 'architect' }
The text was updated successfully, but these errors were encountered:
indiesquidge
No branches or pull requests
Given this JS object
Write me a function that will return a new object (no mutation) with any null or undefined values excluded.
Add in the ability for me to include source objects, similar to the ES6
Object.assign
method.The text was updated successfully, but these errors were encountered: