Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drop-in replacements for Lodash functions (to avoid having to include the lib in the browser).
export function _get(object, path, fallback) {
const value = path.split(".").reduce((hash, field) => hash && hash[field], object);
return typeof value === "undefined" ? fallback : value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.