using anonymous functions to return a value and print to the console