Chrome has faster JavaScript;
Write the following smallProgram:
<HTML>
<Script language = "JavaScript">
VaR sum = 0;
VaR start = new date;
For (VAR I = 0; I <1000001; I ++ ){
Sum + = I;
}
VaR stop = new date;
Document. Write ("cumulative result from 1 to 1000000:" + sum + ";" + "<br/>" + "<br/> ");
Document. Write ("Time consumed" + (stop. gettime ()-start. gettime () + "millisecond ");
</SCRIPT>
</Html>
Run the following commands in chrome and IE 8.0 respectively:
The following is ie 8.0, and the result is a bit miserable ..
Solve the following problems...
Write as follows:Code:
<HTML>
<Script language = "JavaScript">
VaR name = 10001;
Name = Name + 8;
Document. Write ("note the differences between the two! "+ Name +" 666 ");
</SCRIPT>
</Html>
Run the following commands in chrome and IE 8.0 respectively:
Run addition in IE, and add 8 to the string in chrome;