This is an arcade-specific question about using arrays.
I am building a popup based off of this previous post: https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496 and would like to create a 'master list' of field names that always apply to a popup while adding in additional fields based on the content of a specific field.
So, say I have an array of ['a', 'b','c'] and a second array of ['h','j', '5'].
How can I merge those two arrays together into ['a', 'b','c', 'h','j', '5'] (or any other combination of fields, the arrangement doesn't matter currently)?
This is easy enough to do with Python, but I can't find a simple way to do this with Arcade. I was trying to use Insert but when I did the below code segment, I only got the indexes of the array values instead of the values themselves.
var lst1 = ['a', 'b','c'];
var lst2 = ['h','j', '5'];
var newlst = [];
for ( var i in lst2) {
Insert(lst1, 0, i)
}
return lst1