Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Object-Oriented JavaScript - Second Edition

You're reading from   Object-Oriented JavaScript - Second Edition If you've limited or no experience with JavaScript, this book will put you on the road to being an expert. A wonderfully compiled introduction to objects in JavaScript, it teaches through examples and practical play.

Arrow left icon
Product type Paperback
Published in Jul 2013
Publisher Packt
ISBN-13 9781849693127
Length 382 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Stoyan STEFANOV Stoyan STEFANOV
Author Profile Icon Stoyan STEFANOV
Stoyan STEFANOV
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Object-Oriented JavaScript Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
1. Object-oriented JavaScript FREE CHAPTER 2. Primitive Data Types, Arrays, Loops, and Conditions 3. Functions 4. Objects 5. Prototype 6. Inheritance 7. The Browser Environment 8. Coding and Design Patterns Reserved Words Built-in Functions
Built-in Objects Regular Expressions
Index

Index

A

  • accessor descriptors / ECMAScript 5 additions to Object
  • actualWork() function / Function, rewrite thyself!
  • addEventListener() method / Cross-browser event listeners
  • addEventListener/attachEvent methods / Behavior
  • addListener() method / Init-time branching
  • addSubscriber() method / Observer
  • Ajax / XMLHttpRequest
  • anonymous function / Anonymous functions
  • array
    • about / From arrays to objects, Array
    • methods / A few array methods
  • Array.prototype members
    • length / The Array.prototype members
    • concat(i1, i2, i3,...) / The Array.prototype members
    • join(separator) / The Array.prototype members
    • pop() / The Array.prototype members
    • push(i1, i2, i3,...) / The Array.prototype members
    • reverse() / The Array.prototype members
    • shift() / The Array.prototype members
    • slice(start_index, end_index) / The Array.prototype members
    • sort(callback) / The Array.prototype members
    • splice(start, de-lete_count, i1, i2, i3,...) / The Array.prototype members
    • unshift(i1, i2, i3,...) / The Array.prototype members
  • Array constructor
    • about / Array
    • Array.prototype members / The Array.prototype members
    • ECMAScript5 additions to Array / ECMAScript 5 additions to Array
  • array literal notation / From arrays to objects
  • array methods
    • about / A few array methods
    • push() method / A few array methods
    • sort() method / A few array methods
    • join() method / A few array methods
    • slice() method / A few array methods
    • splice() method / A few array methods
  • arrays
    • about / Arrays
    • elements, updating / Adding/updating array elements
    • elements, adding / Adding/updating array elements
    • elements, deleting / Deleting elements
    • array content / Arrays of arrays
  • Asynchronous JavaScript loading / Asynchronous JavaScript loading
  • attributes / ECMAScript 5 additions to Object
  • attributes, DOM nodes / Attributes

B

  • best practice / Scope of variables
  • black box function / Predefined functions
  • BOM / A bit of history
    • overview / BOM and DOM – an overview
    • about / BOM
    • window object, revisiting / The window object revisited
    • window.navigator / window.navigator
    • cheat sheet console / Your console is a cheat sheet
    • window.location / window.location
    • window.history / window.history
    • window.frames / window.frames
    • window.screen / window.screen
    • window.open()/close() / window.open()/close()
    • window.moveTo() / window.moveTo() and window.resizeTo()
    • window.resizeTo() / window.moveTo() and window.resizeTo()
    • window.alert() / window.alert(), window.prompt(), and window.confirm()
    • window.prompt() / window.alert(), window.prompt(), and window.confirm()
    • window.confirm() / window.alert(), window.prompt(), and window.confirm()
    • window.setTimeout() / window.setTimeout() and window.setInterval()
    • window.setInterval() / window.setTimeout() and window.setInterval()
    • window.document / window.document
  • boolean / Boolean
  • Boolean() function / Boolean
  • Boolean constructor
    • about / Boolean
  • Booleans
    • about / Booleans
  • built-in objects
    • data wrapper objects / Built-in objects
    • utility objects / Built-in objects
    • error objects / Built-in objects, Error objects
    • object / Object
    • array / Array
    • function / Function
    • boolean / Boolean
    • number / Number
    • string / String
    • math / Math
    • date / Date
    • RegExp / RegExp
    • augmenting / Augmenting built-in objects, Augmenting built-in objects – discussion
    • prototype gotchas / Prototype gotchas
    • object constructor / Object
    • Array constructor / Array
    • Function constructor / Function
    • Boolean constructor / Boolean
    • Number constructor / Number
    • String constructor / String
    • Date constructor / Date
    • Math constructor / Math
    • RegExp constructor / RegExp
    • JSON / JSON

C

  • $ character / Variables
  • callback function
    • about / Callback functions
    • examples / Callback examples
  • Cascading Style Sheets (CSS) / Content
  • chaining pattern / Chaining
  • child nodes / Child nodes
  • child object
    • parent, accessing / Uber – access to the parent from a child object
  • classes / Classes
  • closures
    • about / Closures
    • scope chain / Scope chain
    • used, for chain breaking / Breaking the chain with a closure
    • closure #1 / Closure #1
    • closure #2 / Closure #2
    • closure #3 / A definition and closure #3
    • in loop / Closures in a loop
    • getter/setter / Getter/setter
    • iterator / Iterator
  • code blocks
    • about / Code blocks
    • variable existence, checking / Checking if a variable exists
    • alternative if syntax / Alternative if syntax
  • coding patterns
    • about / Coding patterns
    • web page, building blocks / Separating behavior
    • namespaces / Namespaces
    • init-time branching / Init-time branching
    • lazy definition pattern / Lazy definition
    • configuration object / Configuration object
    • private properties / Private properties and methods
    • privileged methods / Privileged methods
    • private functions, as public methods / Private functions as public methods
    • immediate functions / Immediate functions
    • modules / Modules
    • chaining pattern / Chaining
    • JSON / JSON
  • comments
    • about / Comments
  • comparison
    • about / Comparison
    • Operator symbols / Comparison
    • Undefined / Undefined and null
    • null / Undefined and null
  • compound operators / Operators
  • conditions
    • about / Conditions and loops
    • if condition / The if condition
    • else clause / The else clause
  • Console tab / WebKit's Web Inspector
  • constructor
    • borrowing / Borrowing a constructor
    • prototype, copying / Borrow a constructor and copy its prototype
  • constructor functions
    • about / Constructor functions
  • constructor property
    • about / The constructor property
    / Prototype gotchas
  • core DOM / Core DOM and HTML DOM
  • Core ECMAScript objects / BOM and DOM – an overview
  • createTextNode() method / Creating new nodes

D

  • data descriptors / ECMAScript 5 additions to Object
  • Date() / Date
  • Date.prototype members
    • toUTCString() / The Date.prototype members
    • toDateString() / The Date.prototype members
    • toTimeString() / The Date.prototype members
    • toLocaleString() / The Date.prototype members
    • toLocaleDateString() / The Date.prototype members
    • toLocaleTimeString() / The Date.prototype members
    • getTime() / The Date.prototype members
    • setTime(time) / The Date.prototype members
    • getFullYear() / The Date.prototype members
    • getUTCFullYear() / The Date.prototype members
    • setFullYear(year, month, date) / The Date.prototype members
    • setUTCFullYear(year, month, date) / The Date.prototype members
    • getMonth() / The Date.prototype members
    • setMonth(month, date) / The Date.prototype members
    • setUTCMonth(month, date) / The Date.prototype members
    • getDate() / The Date.prototype members
    • getUTCDate() / The Date.prototype members
    • setDate(date) / The Date.prototype members
    • setUTCDate(date) / The Date.prototype members
    • getHours() / The Date.prototype members
    • getUTCHours() / The Date.prototype members
    • setHours(hour, min, sec, ms) / The Date.prototype members
    • setUTCHours(hour, min, sec, ms) / The Date.prototype members
    • getMinutes() / The Date.prototype members
    • getUTCMinutes() / The Date.prototype members
    • setMinutes(min, sec, ms) / The Date.prototype members
    • setUTCMinutes(min, sec, ms) / The Date.prototype members
    • getSeconds() / The Date.prototype members
    • getUTCSeconds() / The Date.prototype members
    • setSeconds(sec, ms) / The Date.prototype members
    • setUTCSeconds(sec, ms) / The Date.prototype members
    • getMilliseconds() / The Date.prototype members
    • getUTCMilliseconds() / The Date.prototype members
    • setMilliseconds(ms) / The Date.prototype members
    • setUTCMillise-conds(ms) / The Date.prototype members
    • getTimezoneOffset() / The Date.prototype members
    • getDay() / The Date.prototype members
    • getUTCDay() / The Date.prototype members
  • Date constructor
    • about / Date
    • members / Members of the Date constructor
    • Date.prototype members / The Date.prototype members
    • ECMAScript5 additions / ECMAScript 5 additions to Date
  • date objects
    • working with, methods / Methods to work with date objects, Calculating birthdays
  • date objects methods
    • getMonth() / Methods to work with date objects
    • setMonth() / Methods to work with date objects
    • setHours() / Methods to work with date objects
  • decorate() method / Decorating a Christmas tree
  • decorator
    • about / Decorator
    • Christmas tree, decorating / Decorating a Christmas tree
  • deep copy
    • about / Deep copy
  • design patterns
    • about / Design patterns
    • singleton / Singleton
    • singleton 2 / Singleton 2
    • factory / Factory
    • decorator / Decorator
    • observer / Observer
  • do-while loops
    • about / Do-while loops
  • documentElement / documentElement
  • document node / The document node
  • dom
    • overview / BOM and DOM – an overview
  • DOM / A bit of history
    • about / DOM
    • core DOM / Core DOM and HTML DOM
    • HTML DOM / Core DOM and HTML DOM
    • tree, walking through / Walk the DOM
  • DOM event listeners / DOM event listeners
  • DOM nodes
    • accessing / Accessing DOM nodes
    • document node / The document node
    • documentElement / documentElement
    • child nodes / Child nodes
    • attributes / Attributes
    • internal tag content, accessing / Accessing the content inside a tag
    • access shortcuts / DOM access shortcuts
    • nextSibling / Siblings, body, first, and last child
    • previousSibling / Siblings, body, first, and last child
    • firstChild / Siblings, body, first, and last child
    • lastChild / Siblings, body, first, and last child
    • modifying / Modifying DOM nodes
    • styles, modifying / Modifying styles
    • forms / Fun with forms
    • new nodes, creating / Creating new nodes
  • doSomething() method / Decorator

E

  • ECMA / A bit of history
  • ECMAScript 5
    • about / ECMAScript 5
    • OOP / Object-oriented programming
  • ECMAScript5 additions to Array
    • Array.isArray(obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.indexOf(needle, idx) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.lastIndexOf(needle, idx) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.forEach(callback, this_obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.every(callback, this_obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.some(callback, this_obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.filter(callback, this_obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.map(callback, this_obj) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.reduce(callback, start) / ECMAScript 5 additions to Array
    • Ar-ray.prototype.reduceRight(callback, start) / ECMAScript 5 additions to Array
  • elements / Elements, properties, methods, and members
  • else clause / The else clause
  • encapsulation / Encapsulation
  • enumerable / Enumerating properties
  • enumerated array / Hashes and associative arrays
  • Error.prototype members
    • name / The Error.prototype members
    • message / The Error.prototype members
  • error objects
    • about / Error objects
    • Error.prototype members / The Error.prototype members
  • eval()
    • about / eval()
    • drawbacks, security / eval()
    • drawbacks, performance / eval()
    • alert() function / A bonus – the alert() function
  • events
    • about / Events
    • inline HTML attributes / Inline HTML attributes
    • element properties / Element Properties
    • DOM event listeners / DOM event listeners
    • bubbling / Capturing and bubbling
    • capturing / Capturing and bubbling
    • propagation, stopping / Stop propagation
    • default behavior, preventing / Prevent default behavior
    • cross-browser listeners / Cross-browser event listeners
    • types / Types of events
  • events, types
    • mouse events / Types of events
    • keyboard events / Types of events
    • loading/window events / Types of events
    • form / Types of events
  • exercises / Exercises, Exercises
  • exponent literals / Exponent literals
  • extend() function / Isolating the inheritance part into a function
  • extendCopy() function / Objects inherit from objects, Deep copy

F

  • factory() function / Functions that return objects
  • factory() method / Factory
  • firstname property / Accessing an object's properties
  • foo() function / The prototype property
  • Func-tion.prototype.bind() property / ECMAScript 5 additions to a function
  • function
    • about / What is a function?
    • components / What is a function?
    • calling / Calling a function
    • parameters / Parameters
    • predefined functions / Predefined functions
  • Function() constructor
    • about / Function
    • properties / Properties of function objects
    • prototype property / Prototype
    • function objects, methods / Methods of function objects
    • arguments / The arguments object revisited
    • object types, inferring / Inferring object types
  • Function.prototype members
    • apply(this_obj, params_array) / The Function.prototype members
    • call(this_obj, p1, p2, p3, ...) / The Function.prototype members
    • length / The Function.prototype members
    • ECMAScript5 additions to a function / ECMAScript 5 additions to a function
  • Function constructor
    • about / Function
    • Function.prototype members / The Function.prototype members
  • function expression / Functions are data
  • function literal notation / Functions are data
  • function N() / Closure #2
  • function objects, methods
    • call() / Call and apply
    • apply() / Call and apply
    • say() method / Call and apply
  • functions
    • about / Functions are data
    • anonymous functions / Anonymous functions
    • callback functions / Callback functions
    • immediate functions / Immediate functions
    • inner(private) / Inner (private) functions
    • inner(private), benefits / Inner (private) functions
    • returning values / Functions that return functions
    • replacing / Function, rewrite thyself!
  • future reserved words
    • about / Future reserved words

G

  • Gadget() constructor / Using the prototype's methods and properties
  • getArea() method / Multiple inheritance
  • getAttribute() method / Attributes
  • getDecorator() method / Decorating a Christmas tree
  • getElementByClassName() method / DOM access shortcuts
  • getInfo() method / Adding methods and properties using the prototype
  • getter function / Getter/setter
  • getValue() / Getter/setter
  • global object
    • about / The global object
  • global property / Properties of RegExp objects

H

  • hash / Hashes and associative arrays
  • hasOwnProperty() method / Overwriting a prototype's property with an own property, Enumerating properties
  • hexadecimal numbers / Octal and hexadecimal numbers
  • hoisting / Variable hoisting
  • HTML-only DOM objects
    • about / HTML-only DOM objects
    • accessing, primitive ways / Primitive ways to access the document
    • document.write() / document.write()
    • cookies / Cookies, title, referrer, domain
    • title / Cookies, title, referrer, domain
    • referrer / Cookies, title, referrer, domain
    • domain / Cookies, title, referrer, domain
  • HTML DOM / Core DOM and HTML DOM
  • HTML page
    • JavaScript, including / Including JavaScript in an HTML page

I

  • if condition / The if condition
  • ignoreCase property / Properties of RegExp objects
  • immediate functions / Immediate functions
  • inArray() method / Augmenting built-in objects
  • indexed array / Hashes and associative arrays
  • indexOf() method / String methods that accept regular expressions as arguments
  • infinity
    • about / Infinity
    • NaN / NaN
  • inheritance part
    • isolating, into function / Isolating the inheritance part into a function
  • init-time branching / Init-time branching
  • inline HTML attributes / Inline HTML attributes
  • inner (private) function / Inner (private) functions
  • instanceof operator / The instanceof operator, Prototype chaining example
  • isFinite() function / isFinite()
  • isNaN() function / isNaN()
  • isPrototypeOf() method / isPrototypeOf()
  • iterator functionality / Iterator

J

  • JavaScript
    • history / A bit of history
    • ECMAScript / A bit of history
    • DOM / A bit of history
    • BOM / A bit of history
    • Browser Wars / Browser wars and renaissance
    • uses / The present
    • future / The future
    • including, in HTML page / Including JavaScript in an HTML page
  • join() method / A few array methods
  • JSON / JSON
    • about / JSON
    • members / Members of the JSON object

K

  • keywords, ES5
    • break / Keywords
    • case / Keywords
    • catch / Keywords
    • continue / Keywords
    • debugger / Keywords
    • default / Keywords
    • delete / Keywords
    • do / Keywords
    • else / Keywords
    • finally / Keywords
    • for / Keywords
    • function / Keywords
    • if / Keywords
    • ifn / Keywords
    • instanceof / Keywords
    • new / Keywords
    • return / Keywords
    • switch / Keywords
    • this / Keywords
    • throw / Keywords
    • try / Keywords
    • typeof / Keywords
    • var / Keywords
    • void / Keywords
    • while / Keywords
    • with / Keywords

L

  • lastIndexOf() method / String methods that accept regular expressions as arguments
  • lastIndex property / Properties of RegExp objects , The RegExp.prototype members
  • lazy definition pattern / Lazy definition
  • logical operators
    • about / Logical operators
    • possible operations / Logical operators
    • operator precedence / Operator precedence
    • lazy evaluation / Lazy evaluation
    • Lazy evaluation / Lazy evaluation
  • loops
    • about / Conditions and loops, Loops
    • infinite loop / Loops
    • while loops / While loops
    • for loops / For loops
    • for-in loops / For-in loops

M

  • make() method / Observer
  • match() method / search() and match()
  • Math
    • about / Math
  • Math constructor
    • about / Math
    • members / Members of the Math object
  • maybeExists() function / Error objects
  • members, Date constructor
    • Date.parse(string) / Members of the Date constructor
    • Date.UTC(year, month, date, hours, minutes, seconds, ms) / Members of the Date constructor
  • members, JSON
    • parse(text, call-back) / Members of the JSON object
    • stringi-fy(value, callback, white) / Members of the JSON object
  • members, Math constructor
    • Math.E / Members of the Math object
    • Math.LN10 / Members of the Math object
    • Math.LN2 / Members of the Math object
    • Math.LOG2E / Members of the Math object
    • Math.LOG10E / Members of the Math object
    • Math.PI / Members of the Math object
    • Math.SQRT1_2 / Members of the Math object
    • Math.SQRT2 / Members of the Math object
    • Math.acos(x) / Members of the Math object
    • Math.round(x) / Members of the Math object
    • Math.max(num1, num2, num3, ...) / Members of the Math object
    • Math.abs(x) / Members of the Math object
    • Math.exp(x) / Members of the Math object
    • Math.log(x) / Members of the Math object
    • Math.sqrt(x) / Members of the Math object
    • Math.pow(x, y) / Members of the Math object
    • Math.random() / Members of the Math object
  • members, Number constructor
    • Number.MAX_VALUE / Members of the Number constructor
    • Number.MIN_VALUE / Members of the Number constructor
    • Number.NaN / Members of the Number constructor
    • Number.POSITIVE_INFINITY / Members of the Number constructor
    • Number.NEGATIVE_INFINITY / Members of the Number constructor
  • members, String() constructor
    • String.fromCharCode (code1, code2, code3, ...) / Members of the String constructor
  • methods / Elements, properties, methods, and members
  • modules / Modules
  • multi() function / Multiple inheritance
  • multiline property / Properties of RegExp objects
  • multiple inheritance
    • about / Multiple inheritance
    • mixins / Mixins

N

  • namespace() method / A namespace() method
  • namespaces
    • object / An Object as a namespace
    • constructors / Namespaced constructors
    • namespace() method / A namespace() method
  • NaN / NaN
  • new F() / A temporary constructor – new F()
  • new nodes
    • creating / Creating new nodes
    • DOM-only method / DOM-only method
    • cloneNode() / cloneNode()
    • insertBefore() / insertBefore()
  • new operator / Functions that return objects
  • newtoy.toString() / Own properties versus prototype properties
  • next() function / Iterator
  • NFE / Functions are data
  • nodes
    • removing / Removing nodes
  • now() method / Methods to work with date objects
  • number / Number
  • Number() function / Number
  • Number.prototype members
    • toFixed(fractionDigits) / The Number.prototype members
    • toExponential(fractionDigits) / The Number.prototype members
    • toPrecision(precision) / The Number.prototype members
  • Number constructor
    • about / Number
    • members / Members of the Number constructor
    • Number.prototype members / The Number.prototype members

O

  • %, operators / Operators
  • *, operators / Operators
  • ++, operators / Operators
  • +, operators / Operators
  • -, operators / Operators
  • --, operators / Operators
  • /, operators / Operators
  • Ob-ject.defineProperties(obj, descriptors) property / ECMAScript 5 additions to Object
  • Ob-ject.defineProperty(obj, descriptor) property / ECMAScript 5 additions to Object
  • Ob-ject.getOwnPropertyDescriptor(obj, property) property / ECMAScript 5 additions to Object
  • Ob-ject.getOwnPropertyNames(obj) property / ECMAScript 5 additions to Object
  • Ob-ject.getPrototypeOf(obj) property / ECMAScript 5 additions to Object
  • Ob-ject.isExtensible(obj) property / ECMAScript 5 additions to Object
  • Ob-ject.preventExtensions(obj) property / ECMAScript 5 additions to Object
  • object() function / object(), Parasitic inheritance
  • Object.create(obj, descr) property / ECMAScript 5 additions to Object
  • Object.freeze(obj) property / ECMAScript 5 additions to Object
  • Object.keys(obj) property / ECMAScript 5 additions to Object
  • Object.prototype members
    • constructor / The Object.prototype members
    • toString(radix) / The Object.prototype members
    • toLocaleString() / The Object.prototype members
    • valueOf() / The Object.prototype members
    • hasOwnProper-ty(prop) / The Object.prototype members
    • isPrototypeOf(obj) / The Object.prototype members
    • propertyIsEnumera-ble(prop) / The Object.prototype members
  • Object.seal(obj) property / ECMAScript 5 additions to Object
  • object constructor
    • about / Object
    • Object.prototype / Members of the Object constructor
    • memebers / Members of the Object constructor
    • Object.prototype members / The Object.prototype members
    • ECMAScript5 additions / ECMAScript 5 additions to Object
  • object literal notation / From arrays to objects
  • objects / Objects
    • global object / The global object
    • passing / Passing objects
    • comparing / Comparing objects
    • inheriting, from objects / Objects inherit from objects
  • objects, WebKit console
    • about / Objects in the WebKit console
    • console.log / console.log
  • object’s methods
    • calling / Calling an object's methods
    • altering / Altering properties/methods
  • object’s properties
    • accessing / Accessing an object's properties
    • calling / Altering properties/methods
  • observer pattern / Observer
  • octal number / Octal and hexadecimal numbers
  • OOP
    • about / Object-oriented programming
    • objects / Objects
    • classes / Classes
    • encapsulation / Encapsulation
    • aggregation / Aggregation
    • inheritance / Inheritance
    • polymorphism / Polymorphism
    • summary / OOP summary
    • features / OOP summary
  • operation / Logical operators
  • operators
    • about / Operators
    • + / Operators
    • - / Operators
    • * / Operators
    • / / Operators
    • % / Operators
    • ++ / Operators
    • -- / Operators
  • overriding / Inheritance

P

  • parasitic inheritance
    • about / Parasitic inheritance
  • parseFloat() function / parseFloat()
  • parseInt() function / parseInt()
  • polyfills / Augmenting built-in objects – discussion
  • polymorphism / Polymorphism
  • predefined functions
    • about / Predefined functions
    • parseInt() / parseInt()
    • parseFloat() / parseFloat()
    • isNaN() / isNaN()
    • isFinite() / isFinite()
    • eval() / eval()
  • preventDefault() method / Prevent default behavior, Cross-browser event listeners
  • previously reserved words
    • about / Previously reserved words
  • primitive data types
    • about / Primitive data types, Primitive data types recap
    • typeof operato / Finding out the value type – the typeof operator
    • numbers / Numbers
    • octal numbers / Octal and hexadecimal numbers
    • hexadecimal numbers / Octal and hexadecimal numbers
    • exponent literals / Exponent literals
    • infinity / Infinity
    • in JavaScript / Primitive data types recap
  • privileged methods / Privileged methods
  • properties / Elements, properties, methods, and members
    • copying / Copying properties
  • property descriptors / ECMAScript 5 additions to Object
  • propertyIsEnumerable() method / Enumerating properties
  • prototypal inheritance / object()
  • prototypal inheritance and copy property combination
    • using / Using a mix of prototypal inheritance and copying properties
  • prototype
    • inheriting / Inheriting the prototype only
    • new F() / A temporary constructor – new F()
  • prototype chaining
    • about / Prototype chaining
    • example / Prototype chaining example
    • shared properties, moving / Moving shared properties to the prototype
  • prototype property
    • about / The prototype property
    • used, for method adding / Adding methods and properties using the prototype
    • used, for property adding / Adding methods and properties using the prototype
    • secret __proto__ link / The secret __proto__ link
  • prototype’s methods
    • using / Using the prototype's methods and properties
    • own properties / Own properties versus prototype properties
    • prototype properties / Own properties versus prototype properties
  • prototype’s property
    • overwriting, with own property / Overwriting a prototype's property with an own property
    • enumerating / Enumerating properties
    • isPrototypeOf() method / isPrototypeOf()
  • publish() method / Observer
  • push() method / A few array methods

Q

  • querySelector() method / DOM access shortcuts, Fun with forms
  • querySelectorAll() method / DOM access shortcuts

R

  • radix / parseInt()
  • random() function / Math
  • rating property / Own properties versus prototype properties
  • readystatechange event / Processing the response
  • readyState property / Processing the response
  • Rectangle constructor / Implementation
  • RegExp
    • about / RegExp
    • properties / Properties of RegExp objects
    • methods / Methods of RegExp objects
    • accepting,as parameters / String methods that accept regular expressions as arguments
    • search() method / search() and match()
    • match()method / search() and match()
    • replace() method / replace()
    • callbacks, replacing / Replace callbacks
    • split() method / split()
    • string, passing / Passing a string when a RegExp is expected
    • error objects / Error objects
  • RegExp.prototype members
    • global / The RegExp.prototype members
    • ignoreCase / The RegExp.prototype members
    • multiline / The RegExp.prototype members
    • lastIndex / The RegExp.prototype members
    • source / The RegExp.prototype members
    • exec(string) / The RegExp.prototype members
    • test(string) / The RegExp.prototype members
  • RegExp constructor
    • about / RegExp
    • RegExp.prototype members / The RegExp.prototype members
  • RegExp properties
    • global / Properties of RegExp objects
    • ignoreCase / Properties of RegExp objects
    • multiline / Properties of RegExp objects
    • lastIndex / Properties of RegExp objects
    • source / Properties of RegExp objects
  • removeSubscriber() method / Observer
  • replace() method / replace()
  • replaceChild() method / Removing nodes
  • responseText property / X is for XML, JSON
  • reverse() method / Augmenting built-in objects

S

  • sayName() method / Using the this value
  • Script tab / More consoles
  • search() method / search() and match()
  • secret variable / Getter/setter
  • secret __proto__ link / The secret __proto__ link
  • setter function / Getter/setter
  • setup() function / Iterator
  • setValue() / Getter/setter
  • shapes
    • drawing / Case study – drawing shapes
    • analysing / Analysis
    • implementation / Implementation
    • testing / Testing
  • shims / Augmenting built-in objects – discussion
  • simple assignment operator / Operators
  • Singleton / Singleton
  • Singleton 2
    • about / Singleton 2
    • global variable / Global variable
    • Constructor property / Property of the Constructor
    • in private property / In a private property
  • slice() method / A few array methods
  • someSetup() function / Function, rewrite thyself!
  • sort() method / A few array methods
  • source property / Properties of RegExp objects
  • splice() method / A few array methods
  • split() method / A few methods of string objects, split()
  • stopPropagation() method / Capturing and bubbling, Cross-browser event listeners
  • string
    • about / String
    • methods / A few methods of string objects
  • String() constructor
    • about / String
    • members / Members of the String constructor
    • String.prototype members / The String.prototype members
    • ECMAScript5 additions to String / ECMAScript 5 additions to String
  • String.prototype.trim() property / ECMAScript 5 additions to String
  • String.prototype members
    • length / The String.prototype members
    • charAt(position) / The String.prototype members
    • charCodeAt(position) / The String.prototype members
    • indexOf(needle, start) / The String.prototype members
    • localeCompare(needle) / The String.prototype members
    • match(regexp) / The String.prototype members
    • replace(needle, re-placement) / The String.prototype members
    • search(regexp) / The String.prototype members
    • slice(start, end) / The String.prototype members
    • split(separator, limit) / The String.prototype members
    • substring(start, end) / The String.prototype members
    • toLowerCase() / The String.prototype members
    • toLocaleLowerCase() / The String.prototype members
    • toUpperCase() / The String.prototype members
    • toLocaleUpperCase() / The String.prototype members
  • string methods
    • about / String
    • toLowerCase() / A few methods of string objects
    • charAt() / A few methods of string objects
    • indexOf() / A few methods of string objects
    • lastIndexOf() / A few methods of string objects
    • slice() / A few methods of string objects
    • substring() / A few methods of string objects
    • split() method / A few methods of string objects
  • strings
    • about / Strings
    • conversions / String conversions
    • special strings / Special strings
  • sum() function / Parameters
  • Switch
    • about / Switch

T

  • this value
    • using / Using the this value
  • toString() method / Number, Own properties versus prototype properties, Overwriting a prototype's property with an own property, Prototype chaining example
  • training environment setup
    • about / Setting up your training environment
    • WebKit’s web inspector / WebKit's Web Inspector
    • JavaScriptCore / JavaScriptCore on a Mac
    • consoles / More consoles
  • Triangle constructor / Moving shared properties to the prototype
  • typeof operator / Finding out the value type – the typeof operator, Functions are data

U

  • uber property / Uber – access to the parent from a child object
  • URI / Encode/decode URIs
  • URL / Encode/decode URIs

V

  • valueOf() method / Boolean
  • variables
    • about / Variables
    • $ character / Variables
    • case sensitive / Variables are case sensitive
    • scope / Scope of variables
    • hoisting / Variable hoisting

W

  • W3C / A bit of history, BOM and DOM – an overview
  • WebKit console
    • objects / Objects in the WebKit console
  • WebKit’sWeb Inspector / WebKit's Web Inspector
  • web page, building blocks
    • content / Content
    • presentation / Presentation
    • behavior / Behavior
    • behavior separation, example / Example of separating behavior
    • Asynchronous JavaScript loading / Asynchronous JavaScript loading
  • while loops
    • about / While loops
    • do-while loops / Do-while loops
  • window.alert() / window.alert(), window.prompt(), and window.confirm()
  • window.confirm() / window.alert(), window.prompt(), and window.confirm()
  • window.document / window.document
  • window.frames / window.frames
  • window.history / window.history
  • window.location / window.location
  • window.moveTo() / window.moveTo() and window.resizeTo()
  • window.navigator / window.navigator
  • window.open()/close() / window.open()/close()
  • window.prompt() / window.alert(), window.prompt(), and window.confirm()
  • window.resizeTo() / window.moveTo() and window.resizeTo()
  • window.screen / window.screen
  • window.setInterval() / window.setTimeout() and window.setInterval()
  • window.setTimeout() / window.setTimeout() and window.setInterval()

X

  • XMLHttpRequest
    • about / XMLHttpRequest
    • steps / XMLHttpRequest
    • request, sending / Sending the request
    • response, processing / Processing the response
    • objects, creating in IE / Creating XMLHttpRequest objects in IE prior to Version 7
    • Asynchronous / A is for Asynchronous
    • XML / X is for XML
    • example / An example
  • XMLHttpRequest object / Browser wars and renaissance
lock icon The rest of the chapter is locked
arrow left Previous Section
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images