21, Feb 2023
let numInArray: number[ ] = [ ]; Gives this ERROR ” SyntaxError: Unexpected token ‘:’ “
 instead of
let numInArray: number = ;
let numInArray =  // This will be considered as Array<any>
You can also use the Array<Type> to define the type of element which array will contain.
let numInArray: Array<number> = ;
It should fix the issue and your code should work without any error.