Node.js examples for Array:Associate Array
Combine two associative arrays together
/*/*from w w w. ja v a 2s .c om*/ * combine two associative arrays together * http://stackoverflow.com/questions/929776/merging-associative-arrays-javascript (modified) * * @param {Array} arr * Array object * * @return {Array} new combined associatibe Array * */ Array.prototype.combine = function(arr) { for (item in this) { arr[item] = (arr[item] != undefined) ? arr[item] : this[item]; } return arr; };