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.
Buffer module
Buffer iteration
Report a typo
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 */
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.