complete the anon function with ternary