Lodash _.isArrayBuffer() Method
Last Updated :
03 Nov, 2023
Lodash _.isArrayBuffer() method Checks if the given object or value can be classified as an ArrayBuffer Value or not.
Syntax:
_.isArrayBuffer( value );
Parameters:
- 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: In this example, this method returns true as the given value is an array buffer object.
Javascript
const _ = require( 'lodash' );
let val = new ArrayBuffer(3)
console.log( "The Value is ArrayBuffer : "
+ _.isArrayBuffer(val));
|
Output:
The Value is ArrayBuffer : true
Example 2: In this example, this method returns false as the given value is not an array buffer object it is a string.
Javascript
const _ = require( 'lodash' );
let val = "GeeksforGeeks"
console.log( "The Value is Array : "
+ _.isArrayBuffer(val));
|
Output:
The Value is ArrayBuffer : false
Example 3: In this example, this method returns false as the given value is not an array buffer object.
Javascript
const _ = require( 'lodash' );
let 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
.
Share your thoughts in the comments
Please Login to comment...