The Qur'an describes Allah as having full and perfect knowledge of the past, present, and future. There are also verses that seem to suggest that Allah comes to know about certain things as they happen. The latter talk about the realization in the visible world of God’s foreknowledge, so both sets of verses are totally consistent.
This is a detailed chapter-by-chapter summary of the book “Abrogation in the Qur’an and Islamic Law: A Critical Study of the Concept of ‘Naskh’ and its Impact.” The summary explains the subject of each chapter and how the different chapters are linked to form a comprehensive study of abrogation.
Allah says that all the messengers that He sent before Prophet Muhammad, such as prophet Joseph, were men from various towns, to whom He revealed the Message. In describing the “men to whom We gave revelations” as being “from the people of the towns,” Allah emphasizes that those messengers were human beings who were known to their people.