什么是JavaScript apply()方法?
javascriptapply()方法与call()方法相同,但是将函数参数视为数组。您可以尝试运行以下代码,了解如何在JavaScript中实现apply()方法-
示例
<html>
<head>
<script>
document.write("The highest number in the array list: ");
document.write(Math.max.apply(null,[50,90,18, 87]));
document
</script>
</head>
<body>
</body>
</html>输出结果
The highest number in the array list: 90
热门推荐
10 人民子弟春节祝福语简短
11 新年送老师简短祝福语
12 死人新年祝福语简短句
13 祝福语生日男朋友简短
14 送师姐的祝福语简短
15 新婚抖音祝福语简短
16 麻辣拌店祝福语简短
17 新年祝福语独创文字简短
18 兔年祝福语简短100字