1 var assocIndexOf = require('./_assocIndexOf');
4 * Sets the associative array `key` to `value`.
7 * @param {Array} array The array to modify.
8 * @param {string} key The key of the value to set.
9 * @param {*} value The value to set.
11 function assocSet(array, key, value) {
12 var index = assocIndexOf(array, key);
14 array.push([key, value]);
16 array[index][1] = value;
20 module.exports = assocSet;