mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
17 lines
402 B
JavaScript
17 lines
402 B
JavaScript
import assocIndexOf from './_assocIndexOf';
|
|
|
|
/**
|
|
* 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];
|
|
}
|
|
|
|
export default assocGet;
|