Underscore using within functions

Certified Senior Developer

Hi,

In some ER code, I have found this kind of things :

rule!APP_GreaterTo(value: _, to: 14),

or :
      contains(
        reject(
          isnull(_),
          ri!names
        ),
        tostring(ri!name)
      ),                                                 
Could you explain me what does mean that "_" ?
is it just to specify we do not want to pass any parameter in the function ?  (because "isnull()" is not authorized)
but why "value: _"  in place of "value: null" ?

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to cedric01

    It's not used much anymore, because it was only ever required in the legacy looping functions, and the only one that can't be fully replaced by a!forEach(), is reduce() (sadly).  But we don't need reject() or apply() anymore, so there aren't all that many cases where the _ operator is still needed - which is good because even those of us who knew how to use it, still tended to be fairly confused by it.

Children