[Javascript] Single vs. Double quotes in Javascript

Håkan Magnusson hakan at backbase.com
Fri Nov 14 07:09:40 CST 2003



liorean wrote:
> And the test:
> javascript:var a=50,b=[];while(a--)b.push((function(){var i=new 
> Date,t=5e4,s='';while(t--)s+='text';return (new 
> Date-i);})());while(b.length>1)b[0]+=b.pop();b/=50; // Substitute single 
> for double quotes to get the double quote test
> 
> (I tried to run the test code in ie6w and saf1.0 both, but the browsers 
> just stopped responding each time I did that, so I have no test results 
> from there...)

It doesn't stop, actually. But Moz is *billions* (he he) times faster 
than IE on these string operations, and you get the impression that IE 
hangs. Just wait it out, if you want to see some really sad performance.

I stand corrected regarding the single versius double quote performance 
claim. Sorry about that, I'll check my sources better the next time.

I still want to know the "true" difference between single and double 
quotes, though. If any.




More information about the Javascript mailing list