js基础4

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>test javascript</title>
</head>
<body>
	<script>
		//函数:实现特定功能的可重复使用的函数
		function print(message){//简化输出的函数
			document.write(message);
		}
		function cal(a,b){
			return a+b;//带返回值
		}
		c = cal(2, 3);
		print(c);
	</script>
		
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_43293451/article/details/91376957
js4