UNPKG

402 BJavaScriptView Raw
1import assocIndexOf from './_assocIndexOf';
2
3/**
4 * Gets the associative array value for `key`.
5 *
6 * @private
7 * @param {Array} array The array to query.
8 * @param {string} key The key of the value to get.
9 * @returns {*} Returns the entry value.
10 */
11function assocGet(array, key) {
12 var index = assocIndexOf(array, key);
13 return index < 0 ? undefined : array[index][1];
14}
15
16export default assocGet;