Skip to content

Instantly share code, notes, and snippets.

@miguel-leon
Created June 12, 2019 19:16
Show Gist options
  • Save miguel-leon/5701fafb81a443423057cfe6f8b9456a to your computer and use it in GitHub Desktop.
Save miguel-leon/5701fafb81a443423057cfe6f8b9456a to your computer and use it in GitHub Desktop.
safe access deep properties
const idx = (o, ...p) => p.reduce((a, i) => a && a[i], o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment