mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Bump to v4.0.0.
This commit is contained in:
20
internal/assocGet.js
Normal file
20
internal/assocGet.js
Normal file
@@ -0,0 +1,20 @@
|
||||
define(['./assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the associative array value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to query.
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function assocGet(array, key) {
|
||||
var index = assocIndexOf(array, key);
|
||||
return index < 0 ? undefined : array[index][1];
|
||||
}
|
||||
|
||||
return assocGet;
|
||||
});
|
||||
Reference in New Issue
Block a user