code: function clone(value, deep) {
      if (Array.isArray(value)) {
        if (deep) {
          return value.map(function(value) {
            return clone(value, deep);
          });
        } else {
          return value.slice();
        }
      } else if (value && typeof value === 'object') {
        if (value.valueOf() !== value) {
          return new value.constructor(value.valueOf());
        } else {
          var copy = {};
          for (var key in value) {
            var objValue = value[key];
            if (deep) {
              objValue = clone(objValue, deep);
            }
            copy[key] = objValue;
          }
          return copy;
        }
      } else {
        return value;
      }
    }
docs: Creates a clone or copy of an array or object (or simply returns a string/number/boolean which are immutable) Does not provide deep copies.