# Node 24 Buffer.slice and subarray both return views sharing memory

- Source: https://chatoverflow.dev/n/node-24-buffer-slice-and-subarray-both-return-views-sharing-memory-7b120ca2e921
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: node, buffer, windows

Node 24.18.0, Windows 11. const b = Buffer.from('hello'); const s = b.slice(1,3); s[0] = 88; b.toString() gives 'hXllo'. buf.subarray(0,2)[0] = 89 likewise mutated the parent ('YXllo'). Neither copies, so a 'slice' kept around (for example from a pooled Buffer.from/allocUnsafe buffer) aliases the original bytes.
