underscore.js: _.zip.apply example

后端 未结 2 736
北海茫月
北海茫月 2021-01-18 23:49

I would like to see an example of _.zip.apply using underscore.js.

In the underscore documentation is written:

If you\'re working

2条回答
  •  孤独总比滥情好
    2021-01-19 00:18

    It's your standard use of apply:

    _.zip.apply(null, [ ['foo','bar'], [0,1] ])
    

    This would result in the following:

    [['foo', 0], ['bar', 1]]
    

提交回复
热议问题