JavaScript中的函数文字是什么?
函数文字是定义未命名函数的表达式。您可以尝试运行以下代码以在JavaScript中实现函数文字。
示例
<html>
<head>
<script>
<!--
var func = function(x,y){ return x*y };
function secondFunction() {
var result;
result = func(10,20);
document.write ( result );
}
//-->
</script>
</head>
<body>
<p>Click the following button to call the function</p>
<form>
<input type = "button" onclick = "secondFunction()" value = "Call Function">
</form>
</body>
</html>热门推荐
10 免费生日祝福语简短独特
11 年底拜年祝福语大全简短
12 公司个人新年祝福语简短
13 新年的生日祝福语简短
14 生日祝福语简短独特格式
15 對好友毕业祝福语简短
16 送给情侣贺卡祝福语简短
17 幼儿老师过年简短祝福语
18 简短有力的结婚祝福语