The isTypedArray
function from lodash is used to check if a value is classified as a typed array.
To use it, you need to first install lodash in your project using npm or yarn:
40 chars4 lines
Then, you can import the isTypedArray
function and use it to check if a value is a typed array:
index.tsx241 chars8 lines
In the example above, we import the isTypedArray
function from the lodash library, create a typed array typedArray
using the Uint8Array
constructor, and a regular array notTypedArray
. We then use the isTypedArray
function to check if each of these values is a typed array, and get true
for typedArray
and false
for notTypedArray
.
gistlibby LogSnag