<!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 test(a,b){
var m = a===1?'可乐':'雪碧'
var n = b===1?'薯条':'鸡米花'
var z ="鸡腿堡"
console.log("我是test",m,n,z)
}
test(1,2)
test(2,1)
test()
console.log(a,b)
// 形参只能在函数内部使用
// 可以传参,可以不传参
</script>
</body>
</html>