AI Hints
Home›JavaScript Tutorial›Practice: Objects
JavaScript · Lesson 69 of 138

Objects Quiz

Test yourself.

⏱ 2 min read▶ Video at 1:23:43🎓 Free
Watch this lesson in the JavaScript courseWatch on YouTube ↗Full JavaScript course

Let's check your object skills. Pause before each answer.

Objects Quiz
From the video: Objects Quiz
  • Five questions
  • Pause and think
  • Then listen

Question 1

How do you read a property whose name is stored in a variable called key? The answer is square brackets. Object, open bracket, key, close bracket.

Quick check
Key is in a variable?

Question 2

Inside a method, what does this refer to? The answer is the object the method was called on.

Quick check
this inside a method?

Question 3

Which turns a JSON string into an object? The answer is JSON dot parse.

Quick check
Text to object?

Question 4

After B equals A, for an object A, what is B? The answer is the same object, not a copy.

Quick check
const b = a gives?

Question 5

What does zero, question mark question mark, ten give? The answer is zero, because zero isn't null or undefined.

Quick check
0 ?? 10?

Summary

Great work. Next, a new section, classes, modules, and handling errors.

Key takeaways
  • obj[key]
  • this is the object
  • ?? keeps 0
Next up: Classes — blueprints for objects