let array = [1, [2, 3, [4, 5, ["six", "seven", 6666, [8, 9, [10]]]]]]
//1. Identify and access the last element
//2. Utilize index notation like in **console.log(array[1][2][2][3][2][0]** but should output
// [1][2][2][3][2][0] or 1,2,2,3,2,0
Within this function, I have successfully located the last element but now I am struggling to locate the second question (which requires a recursive function)
function findLastElement(arr){
for (let element of arr ){
if(typeof element === "object"){
findLastElement(element)
console.log(element)
}
}
}
findLastElement(array)