use SC.typeOf and T_FUNCTION as per Dave suggestion