函数返回值的基本用法,函数不仅可以传入数据,也可以传出数据的,用的是ruturn操作的;下面是函数返回值的用法:

 

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script>
function show()

{
return 12;
}
alert(show());
</script>
</head>
<body>

</body>
</html>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script>
function show(a,b)

{
return a+b;
}
alert(show(3,5));
</script>
</head>
<body>

</body>
</html>