[Noisebridge WebDev] JavaScript Class, Array Methods in ECMAScript 5

Garrett Smith dhtmlkitchen at gmail.com
Sat Nov 9 22:24:18 UTC 2013


>From yesterday's class, here are three assignments:
https://noisebridge.net/wiki/JavaScript/Notes/Array#Assignment_1_Write_a_function_that_removes_an_element_from_an_array
.

We diverged into prototype chain yesterday when discussing about how to
call Array.prototype.slice on a host object NodeList.

4.2.1 Objects
http://www.ecma-international.org/ecma-262/5.1/#sec-4.2.1

Every object created by a constructor has an implicit reference (called the
object’s prototype) to the value of its constructor’s “prototype” property.
Furthermore, a prototype may have a non-null implicit reference to its
prototype, and so on; this is called the prototype chain. When a reference
is made to a property in an object, that reference is to the property of
that name in the first object in the prototype chain that contains a
property of that name. In other words, first the object mentioned directly
is examined for such a property; if that object contains the named
property, that is the property to which the reference refers; if that
object does not contain the named property, the prototype for that object
is examined next; and so on.
That "and so on" requires reading another section: Section 15.

http://www.ecma-international.org/ecma-262/5.1/#sec-15

Unless otherwise specified every built-in prototype object has the Object
prototype object, which is the initial value of the expression
Object.prototype
(15.2.4<http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4>),
as the value of its [[Prototype]] internal property, except the Object
prototype object itself.

Object prototype is where the prototype chain ends.
-- 
Garrett
@xkit
ChordCycles.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.noisebridge.net/pipermail/webdev/attachments/20131109/d6887ae8/attachment.html>


More information about the WebDev mailing list