analytics.js
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
function replace ( obj , key , val ) { if ( obj . hasOwnProperty ( key ) ) obj [ key ] = val ; return obj ; }
Replace an objects existing value with a new one

replace({ a : 'b' }, 'a', 'c') -> { a : 'c' }
Replace an objects existing value with a new one