Check If Variable Is Function Javascript