Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver2
8いいね 31回再生

How Does this Work in Object Methods? #coding #codingquiz #programming #codechallenge #frontenddev

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

コメント