<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
function getSum(x, y){
return x + y
}
// 函数返回值给了谁?---函数的调用者getSum(1, 2)
let result = getSum(1, 2)
console.log(result)
// 1.函数名相同,后面覆盖前面
// 2.参数个数不匹配
// 形参过多,多的结果为undefined ,运算输出结果为NaN
// 实参过多,多的实参会被忽略
//break结束循环。return结束函数
</script>
</body>
</html>
07_函数细节
最新推荐文章于 2024-07-21 10:17:51 发布