I'm not sure when the Torah was compiled/written, but this fun fact may be related to the other fun fact that the religion that Judaism evolved from was monolatrist or henotheistic. That is, they only worshipped their one god, but unlike modern monotheists they didn't reject the idea that other gods existed. Much like how a Greek who believes in Zeus and Poseidon might not have any problem believing that Ra and Isis exist, they're just not "the gods I worship".
It's not clear precisely when the early Yahwism transitioned into being monotheistic like they are today. It was probably a fairly gradual process.