Testing Objects for Properties (Basic JavaScript) freeCodeCamp tutorial

preview_player
Показать описание
Do you need more help with coding?
════════════════════════════

Certification: JavaScript Algorithms and Data Structures
Course: Basic JavaScript
Lesson:Testing Objects for Properties
freeCodeCamp tutorial

In this lesson, we learn how to test objects for properties.

Let's Connect 💯:
════════════════════════════
Рекомендации по теме
Комментарии
Автор

can you just use an or statement instead of if/else. return (obj[checkProp] || "Not Found")?

alpoochin
Автор

I don't get why it should be obj[checkprop]? How do you know it"s a variable?

rkitsune
Автор

Is the tutorial video on the website a trick because his code on his screen looks different

theeendo
Автор

Thanks so much man, nice and simple...

TheGOLDENGODZILLA
Автор

Question? Why can't we use => return obj.checkProp; <= why do we have to use bracket notation!!? this makes no sense as we can call obj properties using . or [] notation. Thank you!

HolisticTake