Tile - Array - Index Of – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search

Index Of(Array, Object)

YlandsTile-192.png

indexOf(object: T): number;

Parameters

object

Returns

number Returns position (index) of the specified object. If the item is present more than once, instruction returns the position of the first occurrence. Returns -1 if the object is not found.

Description

Returns position (index) of the specified object. If the item is present more than once, instruction returns the position of the first occurrence. Returns -1 if the object is not found.

Notes

  • Index numbers always start from 0, e.g: Array of length 3 has indexes 0, 1 and 2.