emitwhen example with function/array as first argument working