Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

Node.js Buffer.isBuffer() Method

❮ Buffer Module


Example

Check if an object is a Buffer:

var x = Buffer.from('abc');

console.log(Buffer.isBuffer(x));
Run example »

Definition and Usage

The Buffer.isBuffer() method returns true if the specified object is a Buffer, otherwise false.


Syntax

Buffer.isBuffer(obj);

Parameter Values

Parameter Description
obj Required. The object to check if is a Buffer

Technical Details

Return Value: A Boolean, true if the specified object is a Buffer, otherwise false
Node.js Version: 0.1.101

More Examples

Example

Check if an object is a Buffer:

var x = 'abc';

console.log(Buffer.isBuffer(x));
Run example »

❮ Buffer Module