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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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)