# Array.isTypedArray()

**URL:** <https://es.discourse.group/t/array-istypedarray/2690>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [November 21, 2026, 3:23pm UTC](https://es.discourse.group/t/array-istypedarray/2690 "2026-11-21T15:23:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcubic](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jcubic/32/1927_2.png) [@jcubic](https://es.discourse.group/u/jcubic)\
**Post date:** [November 21, 2026, 3:23pm UTC](https://es.discourse.group/t/array-istypedarray/2690/1 "2026-11-21T15:23:52Z")

</div>

Someone added a comment to my old answer on StackOverflow question on how to check if an object is a TypedArray.

[https://stackoverflow.com/questions/15251879/how-to-check-if-a-variable-is-a-typed-array-in-javascript/65427116?noredirect=1#comment141209386\_65427116](https://stackoverflow.com/questions/15251879/how-to-check-if-a-variable-is-a-typed-array-in-javascript/65427116?noredirect=1#comment141209386_65427116)

My suggestion was:

```javascript
const isTypedArray = (function() {
  const TypedArray = Object.getPrototypeOf(Uint8Array);
  return (obj) => obj instanceof TypedArray;
})();

```

The problem with this, as pointed out in the comment, is that it will not work with a different realm.

Similar to `object instanceof Array`.

There should be a way to check if the object is a TypedArray and nothing else; that will work cross realm, similar to `Array.isArray`.

---

<div class="post-metadata">

**Author:** ![ud2](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ud2/32/1430_2.png) [@ud2](https://es.discourse.group/u/ud2)\
**Post date:** [November 21, 2026, 4:03pm UTC](https://es.discourse.group/t/array-istypedarray/2690/2 "2026-11-21T16:03:53Z")

</div>

You can use `TypedArray.prototype[Symbol.toStringTag]`.

```js
const getTypedArrayName = Object.getOwnPropertyDescriptor(
  Object.getPrototypeOf(Int8Array.prototype),
  Symbol.toStringTag,
).get;

console.log(getTypedArrayName.call(new Int32Array())); // "Int32Array"
console.log(getTypedArrayName.call(new Float64Array())); // "Float64Array"
console.log(getTypedArrayName.call([])); // undefined

```

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [November 22, 2026, 12:27am UTC](https://es.discourse.group/t/array-istypedarray/2690/3 "2026-11-22T00:27:11Z")

</div>

That's essentially the implementation of [https://npmjs.com/which-typed-array](https://npmjs.com/which-typed-array) and [https://npmjs.com/is-typed-array](https://npmjs.com/is-typed-array) .

If sufficient use cases were available, I'd be happy to make a proposal for the predicate.
