In analogy to the introductory HTML/CSS/JS screencast and the gallery of basic effects we put together, this repository is a small gallery of basic, object-oriented behaviors and effects.
You can read more about the approach and technical aspects of what's entailed in Eloquent JavaScript — and on Mozilla's Developer Network.
-
raw.html
— A raw example of something that's kind of painful without object-orientation. -
class.html
— The simplest definition of a class, makingraw.html
a little less painful. -
methodsAndAttributes.html
— Adding custom methods ('verbs' your objects can do) and attributes ('nouns' your object has). -
defineProperty.html
— Adding custom 'getters' (functions which return an attribute) and 'setters' (functions which set an attribute) usingObject.defineProperty
. -
eventCommunication.html
— Using custom events to communicate between objects. -
subclassing.html
— Composing and combining classes. -
mvc.html
— Roughly refactoring our demo to use the "Model-View-Controller" pattern