In JavaScript, every function is varadic. The problem is one of contract, not language. Passing varadic functions to higher-order functions without checking whether the types are compatible will cause a problem in <i>every such language</i>.<p>The problem is parseInt, not map. Consider:<p><pre><code> // using lodash.js (http://lodash.com/)
_.mixin({ args: function () { return _.toArray(arguments); } })
['10','10','10','10'].map(_.compose(parseInt, _.first, _.args)); // #=> [10,10,10,10]</code></pre>