Returns the first index at which target occurs in source as a contiguous run, comparing elements with SameValueZero, or -1 when it does not occur. An empty target occurs at 0.
target
source
-1
0
Time: O(n·m) for sizes n and m.
n
m
The list to search.
The run to find.
The first index of the run, or -1.
TypeError when either argument is not a list from this library.
indexOfSubList(asList([1, 2, 3, 2, 3]), asList([2, 3])) // 1 Copy
indexOfSubList(asList([1, 2, 3, 2, 3]), asList([2, 3])) // 1
Returns the first index at which
targetoccurs insourceas a contiguous run, comparing elements with SameValueZero, or-1when it does not occur. An empty target occurs at0.Time: O(n·m) for sizes
nandm.