Node.js · Middle · Question 18 of 75

What does Buffer.from("привіт").length return?

Explanation

length is in bytes, not characters. Each Cyrillic letter takes 2 bytes in UTF-8. Buffer.byteLength(str) gives the byte size without creating a buffer.

Further reading

Problem with a question

Node.js · Middle · question 18

Test yourself

Take the Node.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz