JS : Search a json object from a list with its partial attribute value : i have a list object which i load from a web service , my list comes in this form :

        list = [ {id:"name1 Surname1" , nb:120} ,
                 {id:"name2", nb:632} , 
                 {id:"name3Surname3", nb:102} , 
                 {id:"surname4", nb:896} 
               ] 

My searaching stretagei is to going by **"id"**
As you can see i have different formats : 

separated name-surname with space , only name , only surname .

My purpose is to search member by id (its name or surname values) ; 
My result should be items whose IDS are containing my searched value item  .

**For example :**

 - If i search for : "name1"  -> **result** : name1 Surname1
 - If i search for : "name1 Surn" -> **result** : name1 Surname1
 - If i search for : "name1 SurAAA" -> **result** : (nothing)
 - If i search for : "AAAA Surname1" -> **result** : (nothing)
 - If i search for : "name1Surname1" -> **result** : (nothing)
 - If i search for : "name" -> **result** : name1 Surname1 , name2 , name3Surname3 , surname4

***To summarize :*** 

i should search items:

 - corresponding for my searched item 
 - beginning with my searched item

I have tried the **filter** solution , like the following :

    findItems(name) {
          this.splits = name.toLowerCase().split(' ');
          if (this.splits.length >= 1) {
            results = this.namesList.filter(item => this.splits.indexOf(item.brand.toLowerCase()) !== -1);
          }else {
            results = [];
          }
      }

But this solution is only searching for items corresponding **exactly** to my searched item , and it lacks the **partial search** 


**Suggestions ?**
