1 /** Used for built-in method references. */
2 var objectProto = Object.prototype;
4 /** Used to check objects for own properties. */
5 var hasOwnProperty = objectProto.hasOwnProperty;
8 * Initializes an array clone.
11 * @param {Array} array The array to clone.
12 * @returns {Array} Returns the initialized clone.
14 function initCloneArray(array) {
15 var length = array.length,
16 result = array.constructor(length);
18 // Add properties assigned by `RegExp#exec`.
19 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
20 result.index = array.index;
21 result.input = array.input;
26 module.exports = initCloneArray;