Create and slice

Report a typo

Create a string, then create a new buffer from that string, slice it, and convert it back to a string to see 'Biden' in the console.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                let slicedBuffer = buffer.slice(4,9);
              
                let buffer = Buffer.from(stringForBuffer);
              
                console.log(slicedBuffer.toString());
              
                let stringForBuffer = 'Joe Biden'
              
___

Create a free account to access the full topic