globalThis
hace referencia al objeto global, sin importar el contexto en el que se encuentre tu código.
Código utilizado en los ejemplos: globalThis.js
Bit completo en:filisantillan.com
Comparto los bits al menos una vez por semana.
Instagram: @fili.santillan
Twitter: @FiliSantillan
Facebook: Fili Santillán
Sitio web: http://filisantillan.com