function foo ( func ) { ??? } foo( function ( global, envType ) { // global -> global object // envType -> 'window' / 'worker' / 'node' });