underscore.js:_. zip.apply示例 [英] underscore.js: _.zip.apply example

查看:72
本文介绍了underscore.js:_. zip.apply示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用underscore.js看到 _.zip.apply 的示例。

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

In编写下划线文档


如果您正在使用嵌套数组矩阵,zip.apply可以以类似的方式转置矩阵。

If you're working with a matrix of nested arrays, zip.apply can transpose the matrix in a similar fashion.

但是,文档没有提供任何示例。

However, the documentation provides no example.

推荐答案

这是你对 apply

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

这将产生以下结果:

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

这篇关于underscore.js:_. zip.apply示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆