title: How to merge the same value
body: <p>I need some help. I would like to merge something like this 12,12,12,13,13,14,14,14,15,15 into 12,13,14,15. i have this code so far. </p>
  
  <pre><code> if ($('#branchName' + branchList.branch).length == 0) {
                      $('#zzz').append(
                          '&lt;span&gt;' + branchList.branch + '&lt;/span&gt;' +
                              '&lt;ul id="branchName' + branchList.branch + '"&gt;' +
                              '&lt;li&gt;' +
                              '&lt;span id="combo' + branchList.combo + '"&gt;' + branchList.combo + '&lt;/span&gt;' +
                              '&lt;/li&gt;' +
                              '&lt;/ul&gt;');
                      if ($('#combo' + branchList.combo).length == 0) {
                          //if exists go to else
                      } else {
                          //append combo
                      }
                  }
  
                  else {
                      $('#branchName' + branchList.branch).append(
                          '&lt;li&gt;' +
                              '&lt;span id="combo' + branchList.combo + '"&gt;' + branchList.combo + '&lt;/span&gt;' +
                              '&lt;/li&gt;');           
                  }
  </code></pre>
  
  <p>Update : I already merge the numbers on my if else by appending it on existing one.  Now my problem is where should I put again the next if statement for my combo. </p>