arrayFlatten(array array, [number depth]) → array newArray
var array = [1, 2, [[3, 4], 5], [6]];
debug(arrayFlatten(array, 1)); // [1,2,[3,4],5,6]Returns a new array containing all the elements of the source array. All the elements contained in a sub-array are extracted into the new array.
var array = [1, 2, [3, 4], 5, [6]]
debug(arrayFlatten(array)) // [1, 2, 3, 4, 5, 6]
debug(arrayFlatten([0, [1], [ [2] ], [ [ [3] ] ] ], 2)); // [0, 1, 2, [3]]
const array = [1, 2, [3, 4], 5, [6]]
Debug.log(array.flat()) // [1, 2, 3, 4, 5, 6]
Debug.log([0, [1], [ [2] ], [ [ [3] ] ] ].flat(2)) // [0, 1, 2, [3] ]
import itertools
array = [1, 2, [3, 4], 5, [6]]
# single-level flatten: chain takes iterables, so the scalars are wrapped
Debug.log(list(itertools.chain.from_iterable(x if isinstance(x, list) else [x] for x in array))) # [1, 2, 3, 4, 5, 6]
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.