JavaScript还具有动态类型。那将意味着用于保存JavaScript中不同数据类型的变量。
<html> <head> <script> var val; val = "Amit"; document.write("String: "+val); val = 20; document.write("<br>Number: "+val); val = 40.90; document.write("<br>Number with decimals: "+val); </script> </head> <body> </body> </html>