<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script type="text/javascript">
function fun() {
if(arguments.length==1 && typeof arguments[0]=='string'){
window.alert("我只有一个参数为string类型")
}else if(arguments.length==2 && typeof arguments[0]=='number'&& typeof arguments[1]=='number'){
window.alert("有两个参数为number类型")
}else{
window.alert("你的调用方式在我意料之外")
}
}
fun("mike")
fun(10,20)
fun(10,20,30,10)
</script>
</body>
</html>