function trycatch( x, y ) {
	if ( !isFunction( x ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );
	}
	try {
		return x();
	} catch ( error ) { // eslint-disable-line no-unused-vars
		return y;
	}
}
If a function does not throw, returns the function return value; otherwise, returns `y`.

@param {Function} x - function to try invoking
@param {*} y - value to return if a function throws
@throws {TypeError} first argument must be a function
@returns {*} either the return value of `x` or the provided argument `y`

@example
var randu = require( '@stdlib/random/base/randu' );

function x() {
    if ( randu() < 0.5 ) {
        throw new Error( 'beep' );
    }
    return 1.0;
}
var z = trycatch( x, -1.0 );
// returns <number>