if (!context) {
        throw new TypeError('Context cannot be null or undefined');
    } else if (typeof predicate !== 'function') {
        throw new TypeError('Predicate must be a function');
    } else {