<html>
<head>
<title>javascript中匿名函数的使用</title>
<script>
/*
匿名函数:
1、匿名函数没有函数名,不能直接调用
2、可以将匿名函数赋值给一个变量,两个变量指向同一个函数体,即可访问
*/
var hello = function (){
document.write("show函数被调用" + "<br/>");
return 10;
}
document.write(hello() + "<br/>");//10
</script>
</head>
<body>
</body>
</html>
javascript中匿名函数的使用
最新推荐文章于 2024-08-25 09:57:22 发布