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