/** Used for built-in method references. */varobjectProto=Object.prototype;/** Used to check objects for own properties. */varhasOwnProperty=objectProto.hasOwnProperty;/** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */functioninitCloneArray(array){varlength=array.length,result=newarray.constructor(length);// Add properties assigned by `RegExp#exec`.if(length&&typeofarray[0]=='string'&&hasOwnProperty.call(array,'index')){result.index=array.index;result.input=array.input;}returnresult;}module.exports=initCloneArray;