為什么輸出結(jié)果會有兩個undefined
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函數(shù)傳參</title>
<script type="text/JavaScript">
? ?function? add3(x,y,z)? ? ? ? ? ? ? ?
{
? sum = x + y +z;
? document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
document.write(add3(5,8,3));
document.write(add3(7,1,4));
</script>
</head>
<body>
</body>
</html>
2019-04-28
你輸入了兩次document.write,你刪了就沒有了