Saturday, October 25, 2025
HomeLanguagesJavascriptLodash _.isBuffer() Method

Lodash _.isBuffer() Method

The Lodash _.isBuffer() Method Checks if the given value is Buffer or not. 

Syntax:

_.isBuffer( 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 Buffer.

Return Value: This method returns a Boolean value( Returns true if the given value is a Buffer, else false).

Example 1: This method returns true when the value is a Buffer.




// Defining Lodash variable
const _ = require('lodash'); 
     
var val = new Buffer(2);
  
// Checking for Buffer
console.log("The Value is Buffer : " 
        +_.isBuffer(val));


Output:

The Value is Buffer : true

Example 2: 




// Defining Lodash variable
const _ = require('lodash'); 
     
var val = new Uint8Array(2);
  
// Checking for Buffer
console.log("The Value is Buffer : " 
        +_.isBuffer(val));


Output:

The Value is Buffer : false
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS