Skip to content

Instantly share code, notes, and snippets.

@EdMSL
Created September 4, 2022 08:28
Show Gist options
  • Select an option

  • Save EdMSL/e3c7dc59501a891d3f12a2de7dc5302e to your computer and use it in GitHub Desktop.

Select an option

Save EdMSL/e3c7dc59501a891d3f12a2de7dc5302e to your computer and use it in GitHub Desktop.
Перевести многоуровневый массив в одноуровневый
const arr = [1,[2,[3,[4,[5]]]]];
const dArray = arr.toString().split(',').map((num) => Number(num));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment