code: function copy(x) {
      switch (getType(x)) {
      case "[object Array]":
        return copyArray(x);
  
      case "[object Object]":
        return copyObject(x);
  
      // TODO is this necessary ?
      case "[object Date]":
        return new Date(x.getTime());
  
      default:
        return x;
      }
    }
docs: TODO can this be made faster ? TODO what about regexps, etc. ?