const similarity = (arr: Array<number>, values: Array<number>) => arr.filter(v => values.includes(v));
      
      Typescript language logo

      Similarity in array elements

      Codiga's TypeScript Recipes

      Returns an array of elements that appear in both arrays.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.