<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<!--函数的四种调用模式-->
<!--方法调用模式-->
<!--函数调用模式-->
<!--构造器调用模式-->
<!--apply调用模式-->
<script>
const add = function(a,b){
return a+b;
};
const arr = [3,4];
const newArr = add.apply(null,arr); //因为JavaScript是一门函数式的面象编程语言,
//所以函数可以拥有方法
console.log(newArr) //7
</script>
</body>
</html>