Execute "and" and "or" in anonymous function