Here's a quick JavaScript quiz!
What will obj.greet() return in this case?
Understand how this works inside object methods.
👇 Drop your answer in the comments & check the explanation there!
✅ Explanation:
A property: name with the value "Abhi".
A method: greet() which returns a greeting using the object's name.
🔍 How it works:
Inside the greet() method, this refers to the object obj.
So this.name accesses the value "Abhi".
The method returns: "Hello Abhi"
#JavaScript
#JSQuiz
#thisKeyword
#ObjectMethod
#CodeChallenge
#WebDevelopment
#LearnToCode
#Shorts
#YouTubeShorts
#TechTok
#FrontendDev
#SoftwareEngineer
コメント