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.
 if ($('#branchName' + branchList.branch).length == 0) {
                    $('#zzz').append(
                        '<span>' + branchList.branch + '</span>' +
                            '<ul id="branchName' + branchList.branch + '">' +
                            '<li>' +
                            '<span id="combo' + branchList.combo + '">' + branchList.combo + '</span>' +
                            '</li>' +
                            '</ul>');
                    if ($('#combo' + branchList.combo).length == 0) {
                        //if exists go to else
                    } else {
                        //append combo
                    }
                }
                else {
                    $('#branchName' + branchList.branch).append(
                        '<li>' +
                            '<span id="combo' + branchList.combo + '">' + branchList.combo + '</span>' +
                            '</li>');           
                }
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.
 
     
     
    