What was the purpose of the account of the Ten Plagues of Egypt, and how did the author or authors of the narrative achieve this?

The Plagues of Egypt

• What was the purpose of the account of the Ten Plagues of Egypt, and how did the author or authors of the narrative achieve this?

• Does it matter whether the narrative is historical/scientific, or metaphorical/allergorical? In other words, does it matter if these plagues REALLY happened, or did the account serve a purpose regardless of its “factual” reality. Whichever way you approach this question, be sure to explain why it matters or does not matter.