The pancreas has dual functions: it acts as both an endocrine and an exocrine gland. The endocrine function involves the secretion of hormones like insulin and glucagon, which regulate blood sugar levels. The exocrine function involves the production of digestive enzymes that help break down carbohydrates, proteins, and fats in the small intestine.