Flattens an array. Basically replacing Array.prototype.flat for which Rhino doesn't yet have an implementation
Array to flatten
Number of layers to flatten by; Infinity for a fully flat array
Flattened array
KoLMafia now supports the flat and flatMap methods
flat
flatMap
Flattens an array. Basically replacing Array.prototype.flat for which Rhino doesn't yet have an implementation