Q:

Write a JavaScript program to convert the length of a given string in bytes

0

Write a JavaScript program to convert the length of a given string in bytes

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const byte_Size = str => new Blob([str]).size;
console.log(byte_Size('123456'));  
console.log(byte_Size('Hello World'));  
console.log(byte_Size('â')); 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now