<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScrip函数表达式</title>
</head>
<body>
<script>
// //函数体
//function sum(x,y) {
// return x+y;
//}
//函数表达式来声明一个函数,匿名函数
var sum = function (x,y) {
return x+y;
}
var a = sum(10,58);//4,5是实参,实际参数
//弹窗
// alert(a);
//直接输出到HTML文档,当前页面
//document.write(a)
//直接向控制台输出
console.log(a);
</script>
</body>
</html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!