Issue with Default Value of 0
valeeum opened this issue · 2 comments
valeeum commented
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 commented
want to do a pull request?
noscripter commented
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.