

So not only now the ID is double-placed but also the window is ambigious. Now because they allowed themselves to do so they would be allowed to add id="submitButton". Now imagine one team has the idea of using window for their component that they are building. Generally in JS we try to modularize more to enable teams to scale and be free from dependencies from other teams. If being used in non-prod envs such as showing something or Sandboxes then it can be very helpful (this is where I actually do use it).īut for prod it should be avoided as a guideline. But it's recommended to be avoided at all costs in programming because it opens up an option to be breached.Īnd the similiar goes for window. Security through Obfuscation is definitely working in the right context. It goes the same principle as always e.g. In production, as stated, it shouldn't be recommended to be used. The problem is that this is viewed from a "small context perspective".
