0

I have a large String variable and I want to check how big this variable is. It's in Javascript.

var data_url = "testestestetestete....................."

How can I determine the size of data_url in bytes?

4
  • .length gets me stringlength, i want it in bytes Commented Mar 13, 2016 at 11:12
  • .length on a string gets me the amount of characters in this string. I want to know how many bytes this String needs in memory Commented Mar 13, 2016 at 11:14
  • The answers in the duplicate are outdated, nowadays you're simply using Blobs: len = new Blob([data_url]).size. Commented Mar 13, 2016 at 11:39
  • thanks, that is what i was looking for! Commented Mar 13, 2016 at 12:37

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.