Skip to content
Related Articles

Related Articles

Lodash _.isBuffer() Method
  • Last Updated : 29 Jul, 2020

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.



filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

The Value is Buffer : true

Example 2: 

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

The Value is Buffer : false

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :