Overview
Review¶
-
What is an object?
-
What is a field?
-
What is a method?
JS Objects¶
An object is a collection of properties.
A property is a named value (similar to a key in a HashMap or a field in a Java class).
In JavaScript an object's property can store a value of any type.
Objects have data properties, which are values that describe an object's state. (In OOP, this would be the value assigned to some field of a particular instance of an object.)
Objects also have methods. A method is a function assigned as a value to a property of an object.
Methods can perform operations using the data properties of each instance of an object.