TypedArray.prototype.lastIndexOf()
TypedArray
实例的 lastIndexOf()
方法返回在类型化数组中可以找到给定元素的最后一个索引,如果不存在则返回 -1。从 fromIndex
开始向后搜索类型化数组。该方法与 Array.prototype.lastIndexOf()
的算法相同。
¥The lastIndexOf()
method of TypedArray
instances returns the last index at which a given element can be found in the typed array, or -1 if it is not present. The typed array is searched backwards, starting at fromIndex
. This method has the same algorithm as Array.prototype.lastIndexOf()
.
Try it
语法
参数
返回值
描述
¥Description
详细信息请参见 Array.prototype.lastIndexOf()
。此方法不是通用的,只能在类型化数组实例上调用。
¥See Array.prototype.lastIndexOf()
for more details. This method is not generic and can only be called on typed array instances.
示例
使用 lastIndexOf()
规范
Specification |
---|
ECMAScript Language Specification # sec-%typedarray%.prototype.lastindexof |
浏览器兼容性
BCD tables only load in the browser