TWorldIsNButThis

能否用 lodash/fp 表达 find one or get first? point free 且 lazy 的那种

  •  
  •   TWorldIsNButThis · Mar 7, 2022 · 1326 views
    This topic created in 1606 days ago, the information mentioned may be changed or developed.

    正常的写法是

    const findOneOrGetFirst = (predicate) => (someTypeList) => someTypeList.find(predicate) || someTypeList[0]
    

    这种写法能否转成 point free 的形式呢? 也就是用函数的组合表达那个逻辑或

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 02:51 · PVG 10:51 · LAX 19:51 · JFK 22:51
    ♥ Do have faith in what you're doing.