One other option would be to use a dynamically created Launch data element.
In the DTM or Launch UI, data elements tend to be strings and nothing else...
But Data Elements are so much more than that. They can hold Arrays, Objects, Functions, really any JS type.
This snippet demonstrates that.
Here it is in the console.

A couple things to note - The `dyn_docs` data element is scoped to the Launch library instance on the page. It can be accessed from any rule using _satellite.getVar from JS. If you navigate away from this page causing Launch to load again, this variable will be undefined until the addFilenameToDocsArray function is called again.