288 B
288 B
byteSize
Returns the length of string.
It converts a given string to a Blob Object and finds it's size
const byteSize = str => new Blob([str]).size;
byteSize("😀"); // 4
byteSize("Hello World"); // 11