Computer scienceBackendNode.jsCore ConceptsInternal modulesBuffers

Buffer module

Time word

Report a typo

You need to fix the program that allocates a buffer of bytes for the word "time". Moreover, the buffer must be of such length that the buffer.toString( ) method returns only the word "time".

There is no need to explicitly write the buffer.toString( ) method. The snippet indicates where the code needs to be added.
Write a program in JavaScript
const { Buffer } = require('buffer');

const buffer = Buffer.alloc(/* your code */);

console.log(buffer);
___

Create a free account to access the full topic