Though I would recommend not just continuously adding more data to a global variable as that will use more and more memory as times goes on. If you just put 10, 100 or even 1000 items - that likely is fine. But if you just keep adding stuff and make 1 million iterations that will likely have negative consequences for your test.
Also, a reminder that this global variables are per VU and so this data will not be shared between VUs and or executions of setup and teardown as those run in separate VUs as well.