source: imaps-frontend/node_modules/lodash-es/_initCloneArray.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 690 bytes
Line 
1/** Used for built-in method references. */
2var objectProto = Object.prototype;
3
4/** Used to check objects for own properties. */
5var hasOwnProperty = objectProto.hasOwnProperty;
6
7/**
8 * Initializes an array clone.
9 *
10 * @private
11 * @param {Array} array The array to clone.
12 * @returns {Array} Returns the initialized clone.
13 */
14function initCloneArray(array) {
15 var length = array.length,
16 result = new array.constructor(length);
17
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;
22 }
23 return result;
24}
25
26export default initCloneArray;
Note: See TracBrowser for help on using the repository browser.