A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/lodash-_-isbuffer-method/ below:

Lodash _.isBuffer() Method - GeeksforGeeks

Lodash _.isBuffer() Method

Last Updated : 03 Sep, 2024

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

Syntax:
_.isBuffer( value );
Parameters: Return Value:

Example 1: In this example, the method returns true when the value is a Buffer.

javascript
// Defining Lodash variable
const _ = require('lodash');

let val = new Buffer(2);

// Checking for Buffer
console.log('The Value is Buffer: '
    + _.isBuffer(val));

Output:

The Value is Buffer : true

Example 2: In this example, the method returns false when the value is not a Buffer.

javascript
// Defining Lodash variable
const _ = require('lodash');

let val = new Uint8Array(2);

// Checking for Buffer
console.log('The Value is Buffer: '
    + _.isBuffer(val));

Output:

The Value is Buffer : false


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4