166 B
166 B
byteSize
Returns the length of string.
const byteSize = str => new Blob([str]).size;
byteSize("😀"); // 4
byteSize("Hello World"); // 11
Returns the length of string.
const byteSize = str => new Blob([str]).size;
byteSize("😀"); // 4
byteSize("Hello World"); // 11