一个参数如何在没有被明确告知的情况下增加?

时间:2017-08-01 12:13:29

标签: javascript function higher-order-functions

在以下increment中,为什么" i"参数function colWidths(rows) { return rows[0].map(function(_, i) { return rows.reduce(function(max, row) { return Math.max(max, row[i].minWidth()); }, 0); }); }

select t1.name, sum(t1.amount)
from table1 t1 join
     (select tt1.id
      from table1 tt1
      group by id
      order by id
      limit 2
     ) tt1
     on t1.id = tt1.id
group by t1.name;

1 个答案:

答案 0 :(得分:4)

传递给map的函数只是用不同的i值调用。您可以编写自己的{{1}}版本的地图函数,如下所示:

{{1}}