-
Notifications
You must be signed in to change notification settings - Fork 15
JSArray.LastIndexOf
boxgaming edited this page Jul 25, 2026
·
3 revisions
Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.
result% = JSArray.LastIndexOf ( a, searchElement [,fromIndex%] )
- The a parameter contains the native Javascript array on which the operation will be performed.
- The searchElement parameter contains the value used for comparison.
- The optional fromIndex% specifies the 0-based index at which to begin the search. If not specified, the search will start at the end of the array.
Import JSArray From "lib/lang/array.bas"
Dim numbers As Object
numbers = JSArray.Create(5, 7, 3, 4, 2, 5, 1, 6)
Print JSArray.LastIndexOf(numbers, 5)
Print JSArray.LastIndexOf(numbers, 5, 3)5
0