X Tutup
The Wayback Machine - https://web.archive.org/web/20230218234044/https://github.com/nodejs/node/commit/6201f23e12
Skip to content
Permalink
Browse files
doc: adding example to Buffer.isBuffer method
PR-URL: #36233
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
ntedgi authored and targos committed May 1, 2021
1 parent 1d78d50 commit 6201f23
Showing 1 changed file with 8 additions and 0 deletions.
@@ -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)`
<!-- YAML
added: v0.9.1

0 comments on commit 6201f23

Please sign in to comment.
X Tutup