Computer scienceBackendNode.jsCore ConceptsInternal modulesBuffers

Buffer module

Buffer iteration

Report a typo

The buffer object can be iterated. This fact can be used to find out what decimal number encodes a particular character. Use the for ... of construct to print each character number to the console.

Write a program in JavaScript
const { Buffer } = require('buffer');

const buffer = Buffer.alloc(4, "word", "utf-8");

for (/* your code */ of /* your code */) {
/* your code */
}
___

Create a free account to access the full topic