The Lodash _.isArrayBuffer() Method Checks if the given object or value can be classified as an ArrayBuffer Value or not.
Syntax:
_.isArrayBuffer( value )
Parameters: This method accepts a single parameter as mentioned above and described below:
- value: This parameter holds the value that needs to be Checked for an ArrayBuffer Value.
Return Value: This method returns a Boolean value.
Example 1: When this method returns true.
Javascript
const _ = require( 'lodash' );
var val = new ArrayBuffer(3)
console.log( "The Value is ArrayBuffer : "
+_.isArrayBuffer(val));
|
Output:
The Value is ArrayBuffer : true
Example 2: When this method returns false for strings.
Javascript
const _ = require( 'lodash' );
var val = "GeeksforGeeks"
console.log( "The Value is Array : "
+_.isArrayBuffer(val));
|
Output:
The Value is ArrayBuffer : false
Example 3:
Javascript
const _ = require( 'lodash' );
var val = { 1:1 }
console.log( "The Value is Array : "
+_.isArrayBuffer(val));
|
Output:
The Value is ArrayBuffer : false
Note: This will not work in normal JavaScript because it requires the lodash library to be installed and can be installed using npm install lodash
.