لَقَدْ كَانَ فِيْ قَصَصِهِمْ عِبْرَةٌ لِّاُولِى الْاَلْبَابِۗ مَا كَانَ حَدِيْثًا يُّفْتَرٰى وَلٰكِنْ تَصْدِيْقَ الَّذِيْ بَيْنَ يَدَيْهِ وَتَفْصِيْلَ كُلِّ شَيْءٍ وَّهُدًى وَّرَحْمَةً لِّقَوْمٍ يُّؤْمِنُوْنَ ࣖ ( يوسف: ١١١ )
Laqad kaana fee qasasihim 'ibratul li ulil albaa; maa kaana hadeesany yuftaraa wa laakin tasdeeqal lazee baina yadihi wa tafseela kulli shai'inw wa hudanw wa rahmatal liqawminy yu'minoon (Yūsuf 12:111)
There was certainly in their stories a lesson for those of understanding. Never was it [i.e., the Quran] a narration invented, but a confirmation of what was before it and a detailed explanation of all things and guidance and mercy for a people who believe. (Yusuf  : 111)
1 Mufti Taqi Usmani
Surely, in the narratives of these, there is a lesson for the people of understanding. It is not an invented story, rather, a confirmation of what has been before it, and an elaboration of everything, and guidance and mercy for a people who believe.