/ LJCJSCodeDoc / LJCCollectionLib / LJCCollection / RetrieveAtIndex


Parameters
index - The index value.

Returns

The collection item at the supplied index.

Syntax

JavaScript
RetrieveAtIndex(index)

Retrieves the object with the supplied index.

Example

JavaScript
// Retrieves the object at the supplied index.
RetrieveAtIndex()
{
  const testItems = new TestItems();
  let testItem = testItems.Add("NameOne");
  testItem.Sequence = 1;
  testItem = testItems.Add("NameTwo");
  testItem.Sequence = 2;

  testItem = testItems.RetrieveAtIndex(1);
  const result = testItem.Name;
  
  // result:
  // NameTwo
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.