Quantcast
Viewing latest article 9
Browse Latest Browse All 19

Answer by Iván Pérez for String length in bytes in JavaScript

Another very simple approach using Buffer (only for NodeJS):

Buffer.byteLength(string, 'utf8')Buffer.from(string).length

Viewing latest article 9
Browse Latest Browse All 19

Trending Articles