Thank you for the comment. It actually should be const [title, Icon] = typeMap.get(cardType.value), I've forgot to update it after introducing the dropdown. I'll fix it in the article.
Thank you for pointing it out!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Alex,
Thanks for this short pro Map, but I don't understand why you can access the Map value element using cardType [Object] only (like this in your code)
const [title, Icon] = typeMap.get(cardType)
and not using his value prop ?
const [title, Icon] = typeMap.get(cardType.value)
Hi Benoit,
Thank you for the comment. It actually should be
const [title, Icon] = typeMap.get(cardType.value)
, I've forgot to update it after introducing the dropdown. I'll fix it in the article.Thank you for pointing it out!