JavaScript/Notes/

From Noisebridge
< JavaScript(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Javascript (talk) to last revision by Garrett)
(Undo revision 47017 by TimFerris (talk))
 
(7 intermediate revisions by 3 users not shown)
Line 11: Line 11:
  
 
'''Reference Conventions''':
 
'''Reference Conventions''':
Each section points to specific sections of the pertinent specification for any given subject matter, and for ECMAScript, with a linked section marker. For example ECMAScript defines the standard for JavaScript ([http://ecma-international.org/ecma-262/5.1/#sec-1 &sect; 1]).
+
Each section points to specific sections of the pertinent specification for any given subject matter, and for ECMAScript, with a linked section marker. For example:
 +
<blockquote><p>ECMAScript defines the standard for JavaScript ([http://ecma-international.org/ecma-262/5.1/#sec-1 &sect; 1]).</p></blockquote>
  
 
All references used in this class are linked from the [[Web Development Resources]] page.
 
All references used in this class are linked from the [[Web Development Resources]] page.
Line 42: Line 43:
  
 
== [[JavaScript/Notes/Prototype|Prototype]] ==
 
== [[JavaScript/Notes/Prototype|Prototype]] ==
The prototype chain is used for reading property resolution.  
+
The prototype chain is used by the engine for reading property resolution.  
  
 
User-defined functions can be used to construct new objects. Objects have, on their prototype chain, the constructor's prototype.  
 
User-defined functions can be used to construct new objects. Objects have, on their prototype chain, the constructor's prototype.  
  
 
'''Prerequisite:''' [[JavaScript/Notes/Function|Functions]].
 
'''Prerequisite:''' [[JavaScript/Notes/Function|Functions]].
 
  
 
== [[JavaScript/Notes/Scope|Scope Chain and Identifier Resolution]]==
 
== [[JavaScript/Notes/Scope|Scope Chain and Identifier Resolution]]==
Line 98: Line 98:
 
'''Prerequisite:''' [[JavaScript/Notes/Function|Functions]].
 
'''Prerequisite:''' [[JavaScript/Notes/Function|Functions]].
  
'''Prerequisite:''' [[JavaScript/Notes/ParameterObject|Parameter Object]]
+
'''Prerequisite:''' [[JavaScript/Notes/ParameterObject|Parameter Object]].
  
 
'''Prerequisite:''' [[JavaScript/Notes/Scope|Scope Chain and Identifier Resolution]].
 
'''Prerequisite:''' [[JavaScript/Notes/Scope|Scope Chain and Identifier Resolution]].
 +
 +
== [[JavaScript/Notes/PrivateProxy|PrivateProxy]] ==
 +
The private proxy exposes a public interface object. This public interface object delegates some of its responsibility to a private instance.
 +
 +
'''Prerequisite:''' [[JavaScript/Notes/Factory|Factory]].
  
 
== [[JavaScript/Notes/Testing|Testing]]==
 
== [[JavaScript/Notes/Testing|Testing]]==

Latest revision as of 22:13, 7 March 2015

You down with OOP? - Yeah you know me!

Contents

[edit] Introduction

Overview: JavaScript Language Fundamentals and design patterns for web programming. See JavaScript.

Teacher: Garrett Smith  

Resources Web Development Resources


Reference Conventions: Each section points to specific sections of the pertinent specification for any given subject matter, and for ECMAScript, with a linked section marker. For example:

ECMAScript defines the standard for JavaScript (§ 1).

All references used in this class are linked from the Web Development Resources page.

[edit] Debugging

Browsers provide debuggers that can be launched from a breakpoint, the application's menu, keyboard shortcut, or the debugger keyword in the script.


[edit] Parameter Object

Passing around lists of parameters? Typechecking arguments? Stop doing that. Here's how to make your code clearer and less error-prone.


[edit] Type Conversion

There are five primitive types in JavaScript: Null, Undefined, Boolean, String, Number. Various operations in JavaScript require conversion to and from primitive values.


[edit] ClassName Swap

Event Delegation and the Cascade.


[edit] Functions

Functions are callable objects with an internal [[Scope]] property. Learn how to call functions and pass functions to other functions, where they can be later called.


[edit] Array Methods added to EcmaScript 5

Sort, map, filter, and more.

Prerequisite: Functions.


[edit] Prototype

The prototype chain is used by the engine for reading property resolution.

User-defined functions can be used to construct new objects. Objects have, on their prototype chain, the constructor's prototype.

Prerequisite: Functions.

[edit] Scope Chain and Identifier Resolution

This class covers closures.

Prerequisite: Functions.


[edit] Custom Events

Fire custom events from your own user-defined objects.

Prerequisite: Functions.

Prerequisite: Scope Chain and Identifier Resolution.


[edit] Singleton

Singleton with information hiding in function scope.

Prerequisite: Functions.

Prerequisite: Scope Chain and Identifier Resolution.


[edit] Interface-Based Design

Prerequisite: Custom Events.

Two Event Registry interface objects that share a similar signature, each with a different implementation detail suited for a specific task. The Devil's in the details -- encapsulate them!


[edit] Event Notification System

An abstract system for event notification.

Prerequisite: Functions.

Prerequisite: Scope Chain and Identifier Resolution.


[edit] DOM Events Adapter

An system for DOM event notification, designed to handle delegation and specific event models.

Prerequisite: Functions.

Prerequisite: Scope Chain and Identifier Resolution.

[edit] Factory

The Factory pattern, the Decorator pattern, newApply, and the holy grail: Abstract Factory.

Prerequisite: Functions.

Prerequisite: Parameter Object.

Prerequisite: Scope Chain and Identifier Resolution.

[edit] PrivateProxy

The private proxy exposes a public interface object. This public interface object delegates some of its responsibility to a private instance.

Prerequisite: Factory.

[edit] Testing

Unit testing with YUI Test.

[edit] Promises

ECMAScript 6 Promises.

Personal tools