Open In App

Underscore.js _.isTypedArray() Function

Last Updated : 14 Oct, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Underscore.js is a JavaScript library that provides a lot of useful functions that help in the programming in a big way like the map, filter, invoke, etc even without using any built-in objects.

The _.isTypedArray() function is an inbuilt function in Underscore.js library of JavaScript which is used to check  if the stated object is a TypedArray or not.

Syntax:

_.isTypedArray(object)

Parameters: It accepts a single parameters which is specified below:

  • object: It is the object stated.

Return Value: This method returns true if the stated object is a TypedArray else it returns false.

Example 1:




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </script>
</head>
  
<body>
    <script>
        console.log(_.isTypedArray(new Int8Array(7, 6)));
    </script>
</body>
  
</html>


Output:

true

Example 2:




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </script>
</head>
  
<body>
    <script>
        console.log(_.isTypedArray("geeksforgeeks.."));
    </script>
</body>
  
</html>


Output:

false

Reference: https://underscorejs.org/#isTypedArray



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads