JavaScript Enlightenment

JavaScript Enlightenment

Cody Lindley

Language: English

Pages: 166

ISBN: 1449342884

Format: PDF / Kindle (mobi) / ePub

If you’re an advanced beginner or intermediate JavaScript developer, JavaScript Enlightenment will solidify your understanding of the language—especially if you use a JavaScript library. In this concise book, JavaScript expert Cody Lindley (jQuery Cookbook) provides an accurate view of the language by examining its objects and supporting nuances.

Libraries and frameworks help you build web applications quickly and efficiently, but when things go wrong or performance becomes an issue, knowing how and why they work is critical. If you’re ready to go under the hood and get your hands dirty with JavaScript internals, this is your book.

  • Get a short and digestible summary of ECMA-262, Edition 3, backed by real code you can run instantly
  • Examine the creation of JavaScript objects
  • Learn complex values, primitive values, scope, and inheritance
  • Understand the importance of the head object
  • Work with string, number, and Boolean objects and values
  • Discover how to use the null value and the built-in math object
  • Get into the details—beyond Mozilla’s reference guide for JavaScript 1.5

World Bank and Urban Development: From Projects to Policy (Routledge Studies in Development and Society)

Sustainability: Building Eco Friendly Communities (Green Technology)

Foundations of Object-Oriented Languages Types and Semantics

Original Wisdom: Stories of an Ancient Way of Knowing

TextMate How-To





















JavaScript, objects can be augmented at any time (i.e., dynamic properties). As previously mentioned, and to be exact, JavaScript has mutable objects. This means that objects created from a constructor function can be augmented with properties. Below, I create an instance from the Array() constructor and then augment it with its own property. Live Code Clearly, the value of this is based on the context in which the function is being called. Consider that both myObject.sayFoo and sayFoo point to the same function. However, depending upon where (i.e., the context)

browsers), instead of the object within which the function is defined. In the code below, this inside of func2 and func3 loses its way and refers not to myObject but instead to the head object. Live Code The takeaway here is that the keyword this is used to refer to instances when used inside of a method contained in the prototype object. If the instance does not contain the property, the prototype lookup begins. Note If the instance or the object pointed to by this does not contain the property being referenced, the same rules that apply to any property lookup get applied and the property will be

Primitive Values Act Like Objects When Used Like Objects using string objects and string primitive values, Conceptual Overview of Using the String() Object working with primitive string values, Primitive/Literal Values Are Converted to Objects When Properties Are Accessed T this keyword, JavaScript Constructors Construct and Return Object Instances, User-Defined/Non-Native Object Constructor Functions, this and arguments Values Available To All Functions, Functions Can Be Nested,

Download sample