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

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

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

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

No branches or pull requests

1 participant