diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 9111e552202f49..d2beb06f593d46 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -730,6 +730,14 @@ 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)`