Within inline events and onload videos, is there an "easy way" to do this in JS...

If...
  dataLayer = []; 

Then use..
   dataLayer.push({}); // declared already - use push to APPEND arrays

Else...
   dataLayer = []; // not declared - so create NEW array

I am trying to reduce the chance that an existing dataLayer array in the header gets overwritten by inline code in the body or within an iFrame.

Help appreciated :)
Shared publicly