Tile - Array - Index Of – Ylands
Jump to navigation
Jump to search
No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}") |
||
Line 34: | Line 34: | ||
---- | ---- | ||
{{Navbox/Ylands}} | {{Navbox/Ylands}} | ||
{{DEFAULTSORT:{{#sub:{{PAGENAME}}| | {{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}} | ||
[[Category: Instructions]] | [[Category: Instructions]] |
Latest revision as of 14:23, 24 November 2023
Index Of(Array, Object)
indexOf(object: T): number;
Parameters
object
Target item in the array
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.
Availability
Client, Server, Custom Controller
Description
Returns position (index) of the selected object in the array.
Notes
- Returns -1 if the object is not found.
- If the item is present more than once, instruction returns the position of the first occurrence.
- Index numbers always start from 0, e.g: Array of length 3 has indexes 0, 1 and 2.