Search
IEnumerable.copyTo Method
See Also
 






Copies a range of elements from this collection to a destination collection.

Namespace: MindFusion.Common.Collections
File: IEnumerable.js

 Syntax

JavaScript  Copy Code

function copyTo (destination, length, [sourceIndex, [destinationIndex]])

 Parameters

destination

IEnumerable. The destination collection.

length

Number. The length of the range to copy.

sourceIndex
Optional.

Number. The starting index of the range to copy.

destinationIndex
Optional.

Number. The index at which the range should be copied.

 Example

The following example copies all items from a collection called janEvents at the end of a collection called febEvents:

JavaScript  Copy Code
janEvents.items.copyTo(febEvents, janEvents.count(), 0, febEvents.count() - 1);

 See Also