Object, Property, Method Flashcards

1
Q

What is an object?

A

An object is a thing or entity in a programming context. Examples include the browser window, a submit button, or a web page document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give an example of objects in a web context.

A

Examples of objects in a web context include the browser window, the submit button on a form, and the entire web page document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a property in programming?

A

A property is a characteristic or attribute of an object. For example, the background color of a web page (document.bgcolor) or the file last modified date (document.lastmodified).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can you give an example of a property and how it is used?

A

An example of a property is img.src, which specifies the source file of an image object. You can both read or set the value of this property.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a method in programming?

A

A method is an action or function that an object can perform. It is like a verb that executes a specific action, such as writing text to a document (document.write()) or submitting a form (form.submit()).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give an example of a method and what it does.

A

The method document.write() writes text to a web page document, and form.submit() submits a form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What can you do with properties in JavaScript?

A

You can either read the value of a property (get its current state) or set a new value for the property (modify it).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly