I'm learning TypeScript.
Playing with types I got stuck trying to resolve the following error:
Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'number | (number | number[])[]'. Property '0' does not exist on type 'number | (number | number[])[]'.
Here is my code
let arr = [2, [22, [222]], 2222];
console.log(arr[1][0]); // 22
I searched around and found examples for objects but I don't know how to do it with a nested array.
How to fix this?
Thanks.