title: Async/Await not working properly with map function ionic 4,typescript
body: <p>As I have mentioned in the title I have a method which contains map function. </p>
  
  <p>I am using ionic 4.</p>
  
  <pre><code> async searchedData(data){
        if(this.searchedItems.length == 0){
          this.clearfilter()
        }
        if(data == "cleardata"){
          this.searchedItems = [];
        }
         else{
         //after searching
         console.log(data)     
        await data.map(async x=&gt;{
          x["file_type"] =x.resource_name.substring(x.resource_name.lastIndexOf('.')+1)
          user.forEach(element =&gt; {
            if(x["user_id"] == element.id){
                  return x["userobj"] = element;
                }
            });
          x["socialIcons"] = this.socialIcons;
          x["user_reaction"] = await this.getCreativeReactions(x)
          console.log(x["user_reaction"]) 
          return x;
        }),
  
          this.searchedItems = this.searchedItems.concat(data);
        }
      }
  </code></pre>
  
  <p>The problem is with this line :</p>
  
  <pre><code>x["user_reaction"] = await this.getCreativeReactions(x) 
   console.log(x["user_reaction"]) 
  </code></pre>
  
  <p><code>getCreativeReactions</code> Code is shown below</p>
  
  <pre><code>getCreativeReactions(x:any){
       this.creativeServices.getCreativeReactions1(x["id"],x["userobj"]["id"]).pipe(map(res1=&gt;res1.json())).subscribe(res1=&gt;{
            x["user_reaction"] = res1;
            x["user_reaction"].forEach(element=&gt;{
              switch(element["latestReaction"]){
               case 'like' :{
                x["socialIcons"][0]["color"] = "danger" 
                x["socialIcons"][0]["operation"] = "cancellike"
                break;
               } 
               case "unlike":{
                x["socialIcons"][1]["color"] = "danger" 
                x["socialIcons"][1]["operation"] = "cancelunlike"
                break;  
               }
               case "cancellike":{
               x["socialIcons"][0]["color"] = "default" 
               x["socialIcons"][0]["operation"] = "like"
                break;
               }
               case "cancelunlike":{
               x["socialIcons"][1]["color"] = "default" 
               x["socialIcons"][1]["operation"] = "unlike"
                break;
               }
              }
            })
            return x["user_reaction"]
          })
  
        }
  </code></pre>
  
  <p>I have a method getCreative reactions which returns an array of objects. But the problem is that though await is prefixed as shown above console.log() executes first and then method is called.Hence i get x["user_reaction"] as undefined. </p>
  
  <p>Am  i going wrong with async/await syntax with map function??</p>