There are no restrictions, the maximum size depends on the browser / implementation.
You can check the limit by running the script as follows:
var str = "";
var sizeCount = 0;
while( true ) {
str += "a";
if( ++sizeCount >= 1048576 ) {
alert( str.length );
sizeCount = 0;
}
}
I get an error in Chrome about 26 MB.
source
share