源代码 :
点击运行
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var myObject, myArray; function myFunction(a, b) { return a * b; } myArray = [10, 2] myObject = myFunction.apply(myObject, myArray); // 返回 20 document.getElementById("demo").innerHTML = myObject; </script> </body> </html>
运行结果