diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 29eec8fca171dd..463b4bbe1b178f 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -743,6 +743,13 @@ added: v0.1.101 Returns `true` if `obj` is a `Buffer`, `false` otherwise. +```js +Buffer.isBuffer(Buffer.alloc(10)); // true +Buffer.isBuffer(Buffer.from('foo')); // true +Buffer.isBuffer('a string'); // false +Buffer.isBuffer([]); // false +Buffer.isBuffer(new Uint8Array(1024)); // false +``` ### Static method: `Buffer.isEncoding(encoding)`