array = [1, 2, 3, 1, 2, 4, 5];

    for (var i = 0; i < array.length; i++){
        for (var j = 0; j < i; j++){
            //if (i != j) {
                if (array[i] == array[j]) {
                    $('#result').append(array[j]+'Repate<br>');
                }
            //}
        }
        $('#result').append(array[i]+'<br>');
    }

##  given output is
    1
    2
    3
    1 Repate
    1
    2 Repate
    2
    4
    5

## But i Want
    1
    2
    3
    1 Repate
    2 Repate
    4
    5
    Give me Some Advice....

Since you are using jquery, so you can jQuery.unique() method to remove duplicate array element.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.