Add multiple items to array

Could the option to add an array of values to the array component be added? If possible, please include a unique version and another that allows duplicates.

It would make adding a list of IDs returned from a SC query (where values already exist in the array) much easier

I've added 3 new methods to the array component.

concat: array1.concat(array2)
concatUniq: array1.concatUniq(array2)
flatten: array1.flatten(depth)

Concat allows you to merge a second array and concatUniq will only add the uniq items. The 3rd method flattens the array, see (Array.prototype.flat() - JavaScript | MDN).

dmxAppConnect.zip (134.6 KB)

Please test it out and let me know if anything needs to be changed.

Thanks @patrick
Perhaps a flattenUniq method would be good to remove duplicate values, if they exist.

Also with the flatten, would you pass Infinity as a string or an unquoted keyword?

Added flattenUniq method and Infinity keyword.

dmxAppConnect.zip (134.8 KB)

Added in Wappler 7.6.1