function keep return 0 when am call it inside author function : everyone, I have this function to compare to list in javaScript

    function listCompare(list1, list2) {
        let result = 0;
        let final = (list1.length + list2.length) / 2;
        for (let x of list1) {
            for (let y of list2) {
                if (x == y) {
                    result += 1;
                }
            }
        }
        return result / final * 100;
    };
its work just fine alone but when call it inside another function it return only zero i don know why this is the full code 

    function listCompare(list1, list2) {
        let result = 0;
        let final = (list1.length + list2.length) / 2;
        for (let x of list1) {
            for (let y of list2) {
                if (x == y) {
                    result += 1;
                }
            }
        }
        return result / final * 100;
    };

    $('#id_password').change(function() {
        // console.log('changed')
        ls1 = time
        ls2 = ob
        var result = listCompare(ls1, ls2)
        console.log(result)
        if (result >= 70) {
        $(':button[type="submit"]').prop('disabled', false);
         }


    });

note: I have two list one of them is time the author on is ob the function shode  return the degree of matching between the two list and five to me 