[英]Obtaining the largest item in a list using ramda
我正在嘗試返回列表page
的最大元素:
page = [1,2,3];
R.max(page); // returns a function.
R.max(-Infinity, page); // seems correct but doesn't work as expected.
使用apply
功能: https : //ramdajs.com/0.22.1/docs/#apply
const page = [1, 2, 3];
R.apply(Math.max, page); //=> 3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.