【发布时间】:2014-10-14 02:08:26
【问题描述】:
有没有办法调用可变长度的插件函数。我将用户输入放入一个看起来像
的变量中Uinput = [5,3,2];
现在我想根据这些数字调用我的插件,所以它会是
addon.myaddon(5,3,2);
我还想将其扩展到 n 个输入,所以如果我的用户输入变量变为
Uinput = [5,3,2,6,...,n];
那么插件将被称为
addon.myaddon(5,3,2,6,...,n);
addon.myaddon(Uinput) // will not seperate the inputs by commas are they are in the array variable, it treats the whole array as the input
这看起来很简单,但给我带来了一些麻烦。有什么建议吗?
【问题讨论】:
标签: javascript node.js variables