promise-some:检查数组中的某些元素是否通过测试并返回Promise

时间:2021-05-22 04:45:42
【文件属性】:
文件名称:promise-some:检查数组中的某些元素是否通过测试并返回Promise
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-22 04:45:42
JavaScript 有前途的 检查数组中的元素是否通过测试并返回 。 安装 $ npm install promise-some 用法 const some = require ( 'promise-some' ) Promise . resolve ( [ 1 , 2 , 3 ] ) . then ( some ( ( val ) => val >= 2 ) ) ) // => true 为什么? 这个模块基本上等效于 ,但是拥有您需要的一个功能而不是厨房水槽很方便。 模块化! 如果要投放到浏览器,并且需要一些JavaScript包大小,则特别方便。 使用在浏览器中很好用! 也可以看看 诺言图 减少承诺 执照 麻省理工学院
【文件预览】:
promise-some-master
----.gitignore(164B)
----.eslintrc(809B)
----package.json(741B)
----.travis.yml(164B)
----LICENSE(1KB)
----index.js(393B)
----test.js(542B)
----README.md(2KB)
----.editorconfig(207B)

网友评论