Quantcast
Channel: String length in bytes in JavaScript - Stack Overflow
Viewing all articles
Browse latest Browse all 19

Answer by Mannan for String length in bytes in JavaScript

$
0
0
str = "Hello, World!";str.length/1024*1024; // here's the number of bytes

above is a shorter way to get the string size in bytes


Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>