Do sometimes the German articles used as a pronouns I heard  someone saying this when his friend asked him with who he have he gone to the supermarket

Freund 1: Mit wem bist du zum Supermarkt gegangen?
Freund 2: *Mit dem*