Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to access Enum in typescript ? giving error "Element implicitly has an any type because index expression is not of type number"

$
0
0
export enum r {  color1 = "Red"  color2 = "green"  color3 = "blue"}ar = ["color1", "color2"];ar.map(e => {  if (r[e as any] !== undefined) {    return r[e]  }})

Above statement giving "Element implicitly has an any type because index expression is not of type number"


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>