Use typeof to test for function