title: Not able to add key-value in array in Javascript
body: <p>In this case I need to add role in array and the code below is what I write but it's not work:</p>
  <pre><code>async.eachSeries(userArray, (singleUser, callback) =&gt; {
                  if (singleUser &amp;&amp; singleUser.userId &amp;&amp; singleUser.userId.userRole) {
                      if (singleUser.userId &amp;&amp; singleUser.userId.userRole.includes('trainer') &amp;&amp; singleUser.isDelete == false) {
                          // singleUser.isSelected = false;
                          singleUser.roleInJob = &quot;trainer&quot;;
                          console.log(&quot;singleUser in if&quot;, singleUser);
                          trainers.push(singleUser);
                          // callback();
                      }
                      if (singleUser.userId &amp;&amp; singleUser.userId.userRole.includes('IQA') &amp;&amp; singleUser.isDelete == false) {
                          // singleUser.isSelected = false;
                          singleUser.role = &quot;IQA&quot;;
                          singleUser['role'] = 'IQA';
                          console.log(&quot;singleUser in if&quot;, singleUser);
                          iqa.push(singleUser);
                          // callback();
                      }
                      callback()
                  } else {
                      callback();
                  }
              }, (callbackError, callbackResponse) =&gt; {
                  if (callbackError) {
                      reject(callbackError)
                  } else {
                      let instructors = {
                          trainers: trainers,
                          iqa: iqa
                      }
                      resolve(instructors)
                  }
              })
  </code></pre>
  <p>Any idea how can I solve this problem?</p>