函数具有返回值,直接调用函数后赋值给变量就可以获取到。function test(){//定一个test函数return 1;//返回值为1}2、获取返回值1var rtn = test();//调用test函数,并把返回值赋值给rtn