Fix 'Cannot read properties of undefined' error 💥 #shorts

preview_player
Показать описание
Sometimes in Javascript you might have an array of objects like this and you to need to get some of the properties of that object that they may or may not exist. With optional chaining you can fix the "Uncaught TypeError: Cannot read properties of undefined.

#javascript
Рекомендации по теме
Комментарии
Автор

I'm having this but the undefined index of Object.icon, the problem is in fontawesome library, 😭

nerina
Автор

How to use this when we are using document.getelementbyid like that
Please tell

nafreefirenaistam