Last Updated : 04 Sep, 2024
Lodash _.isTypedArray() method is used to find whether the given value is a typed array or not. It returns True if the given value is a typed array. Otherwise, it returns false.
Syntax:_.isTypedArray(value);Parameters:
Example 1: In this example, we are getting false as an output because the given value is not a typed array.
javascript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isTypedArray() method
// Passing a array as an argument
console.log(_.isTypedArray([]));
// Passing an array with value as an argument
console.log(_.isTypedArray([1, 2, 3, 4]));
Output:
false
false
Example 2: In this example, we are getting true as an output because the given value is a typed array.
javascript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isTypedArray() method
// Passing a array as an argument
console.log(_.isTypedArray(new Int8Array(8)));
// Passing a typedArray objects Float64Array
console.log(_.isTypedArray(new Float64Array()));
Output:
true
true
Note: This will not work in normal JavaScript because it requires the library lodash to be installed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4