<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
// 我们可以使用 return 语句从函数中返回一个值
// 一个函数中可以有多个 return 语句,但是只有一个 return 语句会被执行
// 在函数的执行体中只要执行到 return 语句之后,函数就调用结束,return 语句后面的其他代码就不再执行了。
// 任何没有返回值的【普通函数】,默认返回 undefined
function foo(x, y, z) {
// return x;
// return y;
// if (x > y) {
// } else {
// }
}
console.log(foo())
</script>
</body>
</html>
来源:CSDN
作者:上头upup
链接:https://blog.csdn.net/qq_45802159/article/details/103246303