Find a Thing

    function findAThing(myArray, decisionPoint) {
        for(const element of myArray) {
            if(decisionPoint(element)) {
                return element;
            }
        }
    }
    
    function isGreaterThan10(number) {
        return number > 10;
    }
    
    function startsWithS(name) {
        return name.startsWith("S")
    }
    
    findAThing([1,2,5,7,11,14], isGreaterThan10);
    findAThing(["Adelaide", "Nathan", "Sky", "Sarah"], startsWithS);

    5 / 27