Are you ready for another code challenge? Join me in this video as you test your coding knowledge with the simple quiz questions.
Don't forget to make your guess in the comments below.
-------------------------------------------------------------------------------------------
🔔Like and subscribe for more videos. 🔔
Connect me on linkedin :
https://www.linkedin.com/in/meenakshilodhi...
https://www.linkedin.com/in/rk-barnwal23/
------------------------------------------------------------------------------------------
Answer OPTION: ) TypeError
Explanation:
The code defines an object person with properties firstName, lastName, and a method fullName that returns the full name by concatenating firstName and lastName.
The method fullName is assigned to the variable fullName.
When fullName() is called, it is invoked without any explicit context. Since it was assigned to the variable fullName, it loses its association with the person object.
As a result, this.firstName and this.lastName inside the fullName method become undefined, leading to a TypeError when trying to concatenate the undefined values.
Therefore, the output will be a TypeError.