mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
16 lines
410 B
JavaScript
16 lines
410 B
JavaScript
var assocIndexOf = require('./_assocIndexOf');
|
|
|
|
/**
|
|
* Checks if an associative array value for `key` exists.
|
|
*
|
|
* @private
|
|
* @param {Array} array The array to query.
|
|
* @param {string} key The key of the entry to check.
|
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
*/
|
|
function assocHas(array, key) {
|
|
return assocIndexOf(array, key) > -1;
|
|
}
|
|
|
|
module.exports = assocHas;
|