title: Typescript - get array that satisfy a condition
body: <p>Is it possible to get an output array from the given that contains roles=1 without duplicate ? 
  Iam using angular 6 typescript. Is there any typescript array processing functions to do this operation
    //Input Array</p>
  
  <pre><code>export const userMenus = [
  {
      name: 'Dashboard',
      url: '/dashboards',
      icon: 'icon-speedometer',
      roles:'1,3,4'
  },
    {
      name: 'Users',
      url: '/Users',
      icon: 'icon-bell',
      roles:'1,2,3,4'
    },
    {
      name: 'Article',
      url: '/Users',
      icon: 'icon-bell',
      roles:'1,2,3,4',
      children: [
               {
                name: 'Cards',
                 url: '/base/cards',
                 icon: 'icon-puzzle',
                 roles:'1,3,4',
               },
               {
                 name: 'Carousels',
                 url: '/base/carousels',
                 icon: 'icon-puzzle',
                 roles:'2,4',
               },
               {
                 name: 'Collapses',
                 url: '/base/collapses',
                 icon: 'icon-puzzle',
                 roles:'4'
               }
              ]      
    }
  </code></pre>
  
  <p>]</p>
  
  <p>--Need Output if role is 2. 
  removed items that not contain 2 in the role field</p>
  
  <pre><code>userMenus = [
    {
      name: 'Users',
      url: '/Users',
      icon: 'icon-bell',
      roles:'1,2,3,4'
    },
    {
      name: 'Article',
      url: '/Users',
      icon: 'icon-bell',
      roles:'1,2,3,4',
      children: [
               {
                 name: 'Carousels',
                 url: '/base/carousels',
                 icon: 'icon-puzzle',
                 roles:'2,4',
               },
              ]      
    }
  </code></pre>