Node.js · Middle · Question 18 of 75
What does Buffer.from("привіт").length return?
- 124
- 26
- ✓Correct answer: 12
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.