3 ms·
Buffer's `slice` is nice to have in many cases though. The pool makes it generally faster. And `allocUnsafe` is a great feature! I like Buffer.
by davidmurdoch 3y ago
Buffer's `slice` is nice to have in many cases though. The pool makes it generally faster. And `allocUnsafe` is a great feature! I like Buffer.
- mofle 3y ago`Buffer.slice` is deprecated: https://nodejs.org/api/buffer.html#bufslicestart-end https://nodejs.org/api/buffer.html#bufslicestart-end
- Etheryte 3y agoAs discussed in another thread, `subarray()`[0] fills the same purpose. [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...