<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>参数</title>
</head>
<body>
<script type="text/javascript">
// es5
function func1(a, b) {
console.log(a, b)
}
func1(10);
// es6
function func2(a, b = 0) {
console.log(a, b)
}
func2(10);
</script>
</body>
</html>
上述运行结果: