Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Default Value of 0 #14

Open
valeeum opened this issue Oct 5, 2018 · 2 comments
Open

Issue with Default Value of 0 #14

valeeum opened this issue Oct 5, 2018 · 2 comments
Labels

Comments

@valeeum
Copy link

valeeum commented Oct 5, 2018

const obj = { a: {b: 3} };
const value = get(obj, 'a.b', {default: 0)); // value equals -> undefined
const value = get(obj, 'a.b', 0); // value equals -> 3

@jonschlinkert
Copy link
Owner

want to do a pull request?

@noscripter
Copy link

noscripter commented Apr 11, 2019

const obj = { a: {b: 3} };
const value = get(obj, 'a.b', {default: 0)); // value equals -> undefined
const value = get(obj, 'a.b', 0); // value equals -> 3

const value = get(obj, 'a.b', {default: 0)); // value equals -> undefined

@valeeum this code is broken and won't run. Don't quite get your point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants