October 6, 1999 - Objects | WebReference

October 6, 1999 - Objects

Yehuda Shiran October 6, 1999
Objects
Tips: October 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

An object is a programming abstraction that groups data with the code that operates on it. It's a "creature" that encapsulates data and its relevant functions. The data is stored in the object's properties. Its functions are called methods. An object named course, for example, could have the following properties:

PropertyExample Content
nameAdvanced JavaScript Programming
codeF12389
dayMonday
time5 pm - 8 pm
studentsName, Age, Address, Telephone

Here are the object's methods:

MethodProcessed Data
initialize()Basic information (name, reference, day, etc.)
addStudent()New student's basic information
deleteStudent()Current student's information
printCourse()Course's information
printStudents()Students' information