The index of the last occurrence of item.

Return -1 if item is not found. Comparison is done with ==.

var a = [10,20,30,10,20,30]
assert a.last_index_of(20)   == 4
assert a.last_index_of(40)   == -1

Property definitions

core $ SequenceRead :: last_index_of
	# The index of the last occurrence of `item`.
	# Return -1 if `item` is not found.
	# Comparison is done with `==`.
	#
	#     var a = [10,20,30,10,20,30]
	#     assert a.last_index_of(20)   == 4
	#     assert a.last_index_of(40)   == -1
	fun last_index_of(item: nullable Object): Int do return last_index_of_from(item, length-1)
lib/core/collection/abstract_collection.nit:954,2--961,91

core $ AbstractArrayRead :: last_index_of
	redef fun last_index_of(item) do return last_index_of_from(item, length-1)
lib/core/collection/array.nit:66,2--75

pthreads $ ConcurrentSequenceRead :: last_index_of
	redef fun last_index_of(e)
	do
		mutex.lock
		var r = real_collection.last_index_of(e)
		mutex.unlock
		return r
	end
lib/pthreads/concurrent_collections.nit:244,2--250,4