title: Concatenate query params and add them to url
body: <p>I have a checkbox of 4 categories (Error, Warning, Info and Debug) and whenever the user check some of them, I have to add them to the query to make an httpclient call.</p>
  
  <p>For example if the user check all of them I should send a query with: (category=eq=Error,category=eq=Warning,category=eq=Info,category=eq=Debug)</p>
  
  <p>That's what I did , I tried to create a string object and concatenate one by one if they are checked :</p>
  
  <pre><code> if (obj.category) {
        const ctgLength = obj.category.length; //the number of categorieschecked by the user
        object["(category=eq"] = obj.category[0];
        for (let i = 1; i &lt; ctgLength - 1; i++) {
        console.log(obj.category[i]);
        object[",category=eq"] = obj.category[i] + ",";
       }
       object["category=eq"] = obj.category[ctgLength - 1] + ")";
     }
  </code></pre>
  
  <p>But what I get is: (category=eq=Error,category=eq=Info,category=eq=Debug)
  The for loop affect only the value of the last iteration.</p>
  
  <p>First: is what I'm doing a good way to generate a query in my case ?
  Second: How can I fix this code to get all the categories in the query ?</p>
  
  <p>Thanks.</p>