[Solved] Test the return value of my function correctly at the time of return [closed]

[ad_1]

You have to test the length property of the return value.

function duplicateElements(m, n) {
    function test(element) {
        return n.includes(element);
    }

    return m.filter(test).length > 0 ? true : false;
}

1

[ad_2]

solved Test the return value of my function correctly at the time of return [closed]