UTF-8 Byte Length
Easy · Buffers
str.length counts UTF-16 code units, not bytes. When you send text over the network, what matters is its size in bytes. In Node you would use Buffer.byteLength(str, "utf8").
Write a function byteLength(str) that returns how many bytes str takes in UTF-8.
Buffer is not available here, but TextEncoder is: new TextEncoder().encode(str) returns a Uint8Array with the UTF-8 bytes.
Next: JSON Response