How to unpack a list inside Javascript


    Nov 27 2013 | 10:18 pm
    Hi.
    Say, the js object take one inlet. But the input is a list of two numbers. And I want the js to unpack the list inside the function and make some calculation. How can I do it?
    If not, how to do the same job but having two inlets with two separate number rather than one.
    Thanks,

    • Nov 28 2013 | 12:34 am
      Make a list() function. The items in the incoming list will be in an array named 'arguments' in that function.
      function list() { for (i=0; i < arguments.length; i++) { post("item ", i+1, "is", arguments[i]+","); } }