我正在使用JS库Underscore,特别是使用_.each和_.sortby库调用.我想知道是否有任何可能的方法来获取迭代器委托中的值的索引
_.sortBy([1, 4, 2, 66, 444, 9], function(num){
/*It'd be great to have access to the index in here */
return Math.sin(num);
});
Run Code Online (Sandbox Code Playgroud)