1. About.com
  2. Computing & Technology
  3. JavaScript

Functions and Object Constructors

From Stephen Chapman, About.com Guide   November 5, 2009

JavaScript doesn't have classes but objects can inherit directly from other objects

In JavaScript object constructors are defined the same way you define a function. What distinguishes one from the other is the way it is called. By testing how it was called inside your function you can make functions that are also object constructors or can test if it is called the right way.

Functions and Object Constructors
Comments
No comments yet.  Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved. 

A part of The New York Times Company.