Skip to content

Instantly share code, notes, and snippets.

@dfkaye
dfkaye / _.get.js
Last active October 1, 2021 19:15
_.get() polyfill for the lodash.js method not available in underscore.js ~ fairly q&d implementation
// 28 June 2017
// Quick-and-dirty implementation.
// 30 Sept 2021
// Changes prompted by @nativekar:
// - Allow pathName param to be either Array or string.
// - Support "value[property]" notation.
// House-cleaning:
// - Move the inline mocha suite to own file, replace with inline test closure.