namespace AnonymousCarProduction { function isItRaining ( ) { return true ; } class Bike { } class Car { } function chooseMyRide ( bike , car ) { if ( isItRaining ( ) ) { return car ( ) ; } else { return bike ; } } function makeCar ( ) { return new Car ( ) ; } chooseMyRide ( new Bike ( ) , ( ) => new Car ( ) ) ; }