essentially a namespace is just a normal object that holds other objects in JS.
by saying MyNameSpace = MyNameSpace|| {}; you just say that if MyNameSpace is already defined, use the existing object, otherwise create a new empty object. This just prevents you from accidentally overriding an existing MyNameSpace definition.
I usually don’t do this but only because I make sure that I load files in a specific order so my namespace is guaranteed to be defined.