Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - (HTML) Why is this variable written like this?
(HTML) Why is this variable written like this?
This is the javascript code embedded in the html page. If you look at the code carefully, these three sentences must appear like this.

& lt script? type="text/javascript "? & gt

//……

var? Box=' teacher';

box = 100;

Alarm (box);

//……

& lt/script & gt; Javascript belongs to weak data type language. Generally speaking, when javascript defines variables, it is not necessary to declare the data type of variables like C language.

This code first declares a variable box? Then assign the string "teacher" to it, and then assign the integer 100 to box. At this point, the value of box is an integer 100. Finally, alert gives this integer 100.

If you are satisfied, please accept it. Thank you.