javascript apply() method เหมือนกับ call() method แต่ถือว่าพารามิเตอร์ function เป็น array คุณสามารถลองเรียกใช้โค้ดต่อไปนี้ เรียนรู้วิธีปรับใช้เมธอด apply() ใน JavaScript -
ตัวอย่าง
<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