How can I shorten the entry into "or"?

  • 0
    export const isBs = (lead: IData): boolean =>
      lead.processingWay === ProcessingWay.Remote &&
      (lead.identityCheck === IdentityCheck.ESIA || lead.identityCheck === IdentityCheck.SMEV); // тут как-то можно сократить?чтобы не писать два раза lead.identityCheck ===

    ProcessingWay and IdentityCheck enums
    JavaScript Anonymous, Feb 1, 2019

  • 2 Answers
  • 0
    maybe like that

    [IdentityCheck.SMEV,IdentityCheck.ESIA].includes(lead.identityCheck )
    Aurora Hansen

  • 0
    Here it is!

    [IdentityCheck.SMEV,IdentityCheck.ESIA].some((a)=>lead.identityCheck===a)
    All options can be here take a look.
    Aurora Marquez

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!