The Wayback Machine - https://web.archive.org/web/20210115224258/https://github.com/sindresorhus/dot-prop/issues/74
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

default value isn't returned when accessing nonexistent obj property within array #74

Closed
mreinstein opened this issue Nov 5, 2020 · 1 comment

Comments

@mreinstein
Copy link

@mreinstein mreinstein commented Nov 5, 2020

const obj = {
  a: [
    { b: 'cool' }
  ]
}

const r = dotProp.get(obj, 'a.0.nonexistant', 'bleep')

expected: r === 'bleep'

actual: r === undefined

@mreinstein mreinstein changed the title default value isn't being set when accessing nonexistent property within array default value isn't returned when accessing nonexistent obj property within array Nov 5, 2020
@mreinstein
Copy link
Author

@mreinstein mreinstein commented Nov 5, 2020

I guess this is a subset of #71 so I'll just close in favor of that.

@mreinstein mreinstein closed this Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.