Problem Statement
What is a Buffer in Node.js and why is it needed?
Explanation
Buffers handle raw binary data in Node.js. They are useful when dealing with file streams, TCP packets, or image data. Buffers are fixed-size byte arrays allocated outside the V8 heap for efficient memory handling.
Code Solution
SolutionRead Only
const buf = Buffer.from('Hello');
console.log(buf.toString());