mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
407 B
17 lines
407 B
9 years ago
|
var assocIndexOf = require('./_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];
|
||
|
}
|
||
|
|
||
|
module.exports = assocGet;
|