Sams Teach Yourself JavaScript in 24 Hours

Sams Teach Yourself JavaScript in 24 Hours

By Michael Moncur

Quiz

Test your knowledge of JavaScript's object-oriented features by answering the following questions.

Questions

1:

What JavaScript keyword is used to create an instance of an object?

  1. object
  2. new
  3. instance
A1:

b. The new keyword creates an object instance.

2:

What is the meaning of the this keyword in JavaScript?

  1. The current object.
  2. The current script.
  3. It has no meaning.
A2:

a. The this keyword refers to the current object.

3:

What does the prototype keyword allow you to do in a script?

  1. Change the syntax of JavaScript commands.
  2. Modify the definitions of built-in objects.
  3. Modify the user's browser so only your scripts will work.
A3:

b. The prototype keyword allows you to modify the definitions of built-in objects.

Share ThisShare This

Informit Network