Is it possible to send a variable number of arguments to a JavaScript function?

后端 未结 12 743
[愿得一人]
[愿得一人] 2020-11-22 10:51

Is it possible to send a variable number of arguments to a JavaScript function, from an array?

var arr = [\'a\',\'b\',\'c\']

var func = function()
{
    //         


        
12条回答
  •  难免孤独
    2020-11-22 11:22

    (function(window) {
      var proxied = window.alert;
      window.alert = function() {
        return proxied.apply(window, arguments);
      };
    }(this));
    
    alert(13, 37);
    

提交回复
热议问题