typescript block scoped variable used before its declaration

Solutions on MaxInterview for typescript block scoped variable used before its declaration by the best coders in the world

showing results for - "typescript block scoped variable used before its declaration"
Kevin
18 Aug 2020
1// true
2let foundIndex:any
3foundIndex = (additionalPassenger as any).findIndex((item) => item.id === passengerId)
4(additionalPassenger as any).splice(foundIndex, 1)
5
6// false
7let foundIndex = (additionalPassenger as any).findIndex((item) => item.id === passengerId)
8(additionalPassenger as any).splice(foundIndex, 1)