jonschlinkert/get-value

Issue with Default Value of 0

valeeum opened this issue · 2 comments

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

want to do a pull request?

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.