<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//函数表达式和具名函数的不同
// 1.函数表达式
fn(1, 2) //错误的,放前面不能用
let fn = function(){
console.log('函数表达式')
}
// 2.具名函数
fnn() //可以放前面调用
function fnn(){
console.log(1)
}
</script>
</body>
</html>
10_匿名函数和具名函数
最新推荐文章于 2024-06-20 20:20:21 发布