values comparations

values comparations

I have two values and I need to compare both, well I have this code but when I do something like this the code doesn't do anything in the if part.

var speechtext = $("#speech").val();
    speechtext = speechtext.replace(/ /g, '');
     var cedula_2 = new String(speechtext);
    var elements = document.getElementsByClassName("index");
    for (var i = 0; i < elements.length; i++) {
        var prueba = elements[i].innerHTML.replace('<span id="MainContent_dt_estudiantes_lblcedula_', '');
        prueba = prueba.replace('style="display:inline-block;width:100px;">', '');
        prueba = prueba.replace('</span>', '');
        prueba = prueba.replace('" ', ',');
        var lista = prueba.split(',');
     
        var cedula = new String(lista[1]);
        window.open(typeof cedula_2, 'window name', 'window settings');
       sometimes are the same values but it doesn't work.
        if (cedula == cedula_2)
        {
            alert(cedula);
            i = 1000;
        }


lista has two values
lista[0] = 0
lista[1] = 114808080

I'm sure that the array list has values  and the cedula_2 also has values and sometimes is the same but the condition of the "if "doesn't work.
I need some help with I'm new in this forum

Thanks,