js函数 找出较大的值

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<script type="text/javascript">

var res=max(11,12);
alert("较大的值: "+res);

function max(m,n){
if(m>n){
return m;
}else{
return n;
}
}
</script>
<body>
</body>
</html>

posted @ 2021-06-04 23:46  张钊z  阅读(94)  评论(0)    收藏  举报