Then, when We decreed (Solomon's) death, nothing showed them his death except a little worm of the earth, which kept (slowly) gnawing away at his staff: so when he fell down, the Jinns saw plainly that if they had known the unseen, they would not have tarried in the humiliating Penalty (of their Task). (14)
Tafsir
When it was time for Solomon to die, he was leaning on a stick and having some constructive work done by the ‘jinn’. The angel of death took away his life-spirit, but his lifeless body, with the support of the stick remained upright. The jinn continued with their work under the impression that he was nearby supervising the work. It so happened that some white ants infested the stick and after some time, when the white ants had made the stick hollow, his body fell on to the ground. It was then that the jinn came to know that Solomon had died. This incident suffices to remove the erroneous popular belief that the jinn have knowledge of the future.
Alternatively, you may use the smart search feature provided below