MCQ
Single Best Answer
Not Set
QIn JavaScript, how should a new property be added to an object?
ID: #4854
Basic JavaScript MCQ
188 views
Question Info
#4854Q ID
Not SetDifficulty
Basic JavaScript MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
obj.newProperty = 'value'; is the correct way to add a new property to an object in JavaScript.
You can use the dot notation (obj.property) or the square bracket notation (obj['property']) to add a new property to an object.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic