Those younger than twenty years of age at the time when the spies were originally sent by Moses into the land of Canaan would likely still have been alive at the time of Joshua's speech. Their parents had passed away in the wilderness (Numbers 14:29), but they would nonetheless have seen the miraculous events of the Exodus (as well as the conquest). They would have seen what the Lord did in Egypt. A lot of people, however, would have been born only after the Exodus and thus only heard of those events from their parents. By using inclusive language, Joshua is referring to the community as a whole, identifying the former generation and the present as one and the same.1 Moses does something very similar in Deuteronomy 5:2–3.
7 And when they cried to the LORD, he put darkness between you and the Egyptians and made the sea come upon them and cover them; and your eyes saw what I did in Egypt. And you lived in the wilderness a long time.