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