Open In App

Underscore.js _.isDataView() Function

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 _.isDataView() function is an inbuilt function in Underscore.js library of JavaScript which is used to check  if the stated object is a DataView or not.



Syntax:

_.isDataView(object)

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



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

Example 1:




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </script>
</head>
  
<body>
    <script>
        var buff = new ArrayBuffer(11);
          
        console.log(_.isDataView(
            new DataView(buff, 3, 5)));
    </script>
</body>
  
</html>

Output:

true

Example 2:




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

Output:

false

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


Article Tags :