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


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

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