<script>标签
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>my test</title> </head> <body> <script src="example.js"></script> </body> </html>
语法
var lennon=Array(); lennon["name"]="John"; lennon["year"]=1940; lennon["living"]=false;
var lennon=Object(); lennon.name="John"; lennon.year=1940; lennon.living=false;
var lennon={name:"John",year:1940,living:false};
function name(arguments) { statements; //return.... }
function square(num) { total=num*num; return total; } var total=50; var num=square(20); alert(num); /* output: 400 */
原文:https://www.cnblogs.com/xuwanwei/p/10800375.html