0

I wanted to have a function that accepts multiple integer parameters and I am not sure how may parameters will be passed to the function, but I will use all the parameters passed.

It will be some think like this

function abc(.......){
    // I want to transfer all the parameters passed to one array
    var xyz = arguments[];
}
abc(1,2,3,4,5,.....);
tsinat
  • 235
  • 1
  • 3
  • 16
  • What is your question? You may want to read: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments and this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters – colecmc Feb 05 '16 at 01:05
  • 2
    Try here: http://stackoverflow.com/questions/1959040/is-it-possible-to-send-a-variable-number-of-arguments-to-a-javascript-function – Richard Walton Feb 05 '16 at 01:06
  • 1
    Why not just pass in an array of integers, and iterate over them within the function? – OscuroAA Feb 05 '16 at 01:07

0 Answers0