79234864

Date: 2024-11-28 17:37:59
Score: 1
Natty:
Report link
const array = [[[0], [1]], [[2], [3]], [[4], [5]]] 
const result = [];

function flattenArray(array) {
  for (let i = 0; i < array.length; i++) {
    if (typeof array[i] === "object") {
      flattenArray(array[i]);
    } else {
      result.push(array[i]);
    }
  }
}
flattenArray(array);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: roystan dsouza