Pro JavaScript Techniques 2nd Edition John Resig - The ebook in PDF/DOCX format is ready for download now
Pro JavaScript Techniques 2nd Edition John Resig - The ebook in PDF/DOCX format is ready for download now
https://ebookfinal.com/download/pro-javascript-design-patterns-1st-
edition-ross-harmes/
https://ebookfinal.com/download/javascript-a-beginner-s-guide-third-
edition-john-pollock/
https://ebookfinal.com/download/learning-javascript-2nd-edition-
shelley-powers/
https://ebookfinal.com/download/object-oriented-javascript-2nd-
edition-stoyan-stefanov/
Advanced Javascript 2E 2nd Edition Chuck Easttom
https://ebookfinal.com/download/advanced-javascript-2e-2nd-edition-
chuck-easttom/
https://ebookfinal.com/download/pro-puppet-2nd-edition-spencer-krum/
https://ebookfinal.com/download/the-musician-s-guide-to-pro-tools-1st-
edition-john-keane/
www.it-ebooks.info
Contents at a Glance
■
■Chapter 1: Professional JavaScript Techniques���������������������������������������������������� 1
■
■Chapter 2: Features, Functions, and Objects��������������������������������������������������������� 7
■
■Chapter 3: Creating Reusable Code��������������������������������������������������������������������� 23
■
■Chapter 4: Debugging JavaScript Code��������������������������������������������������������������� 39
■
■Chapter 5: The Document Object Model�������������������������������������������������������������� 49
■
■Chapter 6: Events������������������������������������������������������������������������������������������������ 73
■
■Chapter 7: JavaScript and Form Validation��������������������������������������������������������� 95
■
■Chapter 8: Introduction to Ajax������������������������������������������������������������������������� 107
■
■Chapter 9: Web Production Tools����������������������������������������������������������������������� 117
■
■Chapter 10: AngularJS and Testing������������������������������������������������������������������� 125
■
■Chapter 11: The Future of JavaScript���������������������������������������������������������������� 141
■
■Appendix A: DOM Reference������������������������������������������������������������������������������ 161
Index��������������������������������������������������������������������������������������������������������������������� 177
www.it-ebooks.info
Chapter 1
Welcome to Pro JavaScript Techniques. This book provides an overview of the current state of JavaScript,
particularly as it applies to the professional programmer. Who is the professional programmer? Someone
who has a firm grasp of the basics of JavaScript (and probably several other languages). You are interested
in the breadth and depth of JavaScript. You want to look at the typical features like the Document Object
Model (DOM), but also learn about what’s going on with all this talk of Model-View-Controller (MVC) on the
client side. Updated APIs, new features and functionality, and creative applications of code are what you are
looking for here.
This is the second edition of this book. Much has changed since the first edition came out in 2006.
At that time, JavaScript was going through a somewhat painful transition from being a toy scripting language
to being a language that was useful and effective for several different tasks. It was, if you will, JavaScript’s
adolescence. Now, JavaScript is at the end of another transition: to continue the metaphor, from adolescence
to adulthood. JavaScript usage is nearly ubiquitous, with anywhere from 85 to 95 percent of websites,
depending on whose statistics you believe, having some JavaScript on their main page. Many people speak
of JavaScript as the most popular programming language in the world (in the number of people who use it
on a regular basis). But more important than mere usage are effectiveness and capability.
JavaScript has transitioned from a toy language (image rollovers! status bar text manipulations!) to
an effective, if limited tool (think of client-side form validation), to its current position as a broad-featured
programming language no longer limited to mere browsers. Programmers are writing JavaScript tools that
provide MVC functionality, which was long the domain of the server, as well as complex data visualizations,
template libraries, and more. The list goes on and on. Where in the past, designers would have relied on a
.NET or Java Swing client to provide a full-featured, rich interface to server-side data, we can now realize that
application in JavaScript with a browser. And, using Node.js, we have JavaScript’s own version of a virtual
machine, an executable that can run any number of different applications, all written in JavaScript and none
requiring a browser.
This chapter will describe how we got here and where we are going. It will look at the various
improvements in browser technology (and popularity) that have abetted the JavaScript Revolution. The state
of JavaScript itself needs inspection, as we want to know where we are before we look at where we are going.
Then, as we examine the chapters to come, you will see what the professional JavaScript programmer needs
to know to live up to his or her title.
www.it-ebooks.info
Chapter 1 ■ Professional JavaScript Techniques
upon the make, model, and version of browser visiting said programmer’s website. By the mid-2000s, the
browser wars of the 90s had been easily won by Internet Explorer, and browser development stagnated.
Two browsers challenged this state of affairs: Mozilla Firefox and Google Chrome. Firefox was the
descendant of Netscape, one of the earliest web browsers. Chrome had Google’s backing, more than
enough to make it an instant player on the scene.
But both of these browsers made a few design decisions that facilitated the JavaScript revolution.
The first decision was to support the World Wide Web consortium’s implementation of various standards.
Whether dealing with the DOM, event handling, or Ajax, Chrome and Firefox generally followed the spec
and implemented it as well as possible. For programmers, this meant that we didn’t have to write separate
code for Firefox and Chrome. We were already used to writing separate code for IE and something else, so
having branching code in itself was not new. But making sure that the branching was not overly complex was
a welcome relief.
Speaking of standards, Firefox and Chrome also put in a lot of work with the European Computer
Manufacturer’s Association (ECMA, now styled Ecma). Ecma is the standards body that oversees JavaScript.
(To be technical, Ecma oversees the ECMAScript standard, since JavaScript is a trademark of Oracle and…
well, we don’t really care about those details, do we? We will use JavaScript to refer to the language and
ECMAScript to refer to the specification to which a JavaScript implementation adheres.) ECMAScript
standards had languished in much the same way as IE development. With the rise of real browser
competition, the ECMAScript standard was taken up again. ECMAScript version 5 (2009) codified many of
the changes that had been made in the ten years (!) since the previous version of the standard. The group
itself was also energized, with version 5.1 coming out in 2011. The future is provided for, with significant
work currently being done on both versions 6 and 7 of the standard.
To give credit where credit is due, Chrome pushed the updating of JavaScript as well. The Chrome
JavaScript engine, called V8, was a very important part of Chrome’s debut in 2008. The Chrome team built
an engine that was much faster than most JavaScript engines, and it has kept that goal at the top of the list
for subsequent versions. In fact, the V8 engine was so impressive that it became the core of Node.js, a
browser-independent JavaScript interpreter. Originally intended as a server that would use JavaScript
as its main application language, Node has become a flexible platform for running any number of
JavaScript-based applications.
Back to Chrome: the other major innovation Google introduced to the land of browsers was the concept
of the evergreen application. Instead of having to download a separate browser install for updates, Chrome’s
default is to automatically update the browser for you. While this approach is sometimes a pain in the
corporate world, it is a great boon to the noncorporate consumer surfer (also known as a person!). If you use
Chrome (and, for the last few years, Firefox), your browser is up-to-date, without your having to make any
effort. While Microsoft has done this for a long time in pushing security updates via Windows Update, it
does not introduce new features to Internet Explorer unless they are coupled to a new version of Windows.
To put it another way, updates to IE are slow in coming. Chrome and Firefox always have the latest and
greatest features, as well as being quite secure.
As Google pressed on with Chrome’s features, the other browser makers played catch-up. Sometimes
this came in sillier ways, such as when Firefox adapted Chrome’s version numbering. But it also resulted in
Mozilla and Microsoft taking a cold, hard look at JavaScript engines. Both browser makers have significantly
overhauled their JS engines over the last few years, and Chrome’s lead, while formidable, is no longer
insurmountable.
Finally, Microsoft has (mostly) thrown in the towel on its classic “embrace and extend” philosophy, at
least when it comes to JavaScript. With IE version 9, Microsoft implemented World Wide Web Consortium
(W3C) event handling and standardized its DOM interfaces as well as its Ajax API. For most of the standard
features of JavaScript, we no longer have to implement two versions of the same code! (Legacy code for
legacy browsers is still a bit of an issue, of course…)
It seems almost a panacea. JavaScript is faster than ever before. It is easier to write code for a variety
of different browsers. Standards documents both describe the real world and provide a useful roadmap to
features to come. And most of our browsers are fully up-to-date. So what do we need to worry about now,
and where are we going in the future?
www.it-ebooks.info
Chapter 1 ■ Professional JavaScript Techniques
Modern JavaScript
It has never been easier to develop serious applications with JavaScript. We have a clear, clean break with
the bad old days of separate code for multiple browsers, poor standards poorly implemented, and slow
JavaScript engines that were often an afterthought. Let’s take a look at the state of the modern JavaScript
environment. Specifically, we will look at two areas: the modern browser and the modern toolkit.
Modern JavaScript depends on the idea of the modern browser. What is the modern browser? Different
organizations describe it in different ways. Google says that their applications support the current and
previous major versions of browsers. (Fascinating, as Gmail still works on IE9, as far as we can tell!) In an
interesting article, the people behind the British Broadcasting Company (BBC) website revealed that they
define a modern browser as one that supports the following capabilities:
1. document.querySelector() / document.querySelectorAll()
2. window.addEventListener()
3. The Storage API (localStorage and sessionStorage)
jQuery, probably the most popular JavaScript library on the web, split its versions into the 1.x line,
which supports IE 6 and later, and the 2.x line, which supports “modern” browsers like IE 9 and later. And
make no mistake, IE is the dividing line between the modern and the ancient. The other two major browsers
are evergreen. And while Safari and Opera are not evergreen, they update on a faster schedule than IE and
don’t have nearly the market share it does.
So where is the borderline for the modern browser? Alas, the border seems to wander between Internet
Explorer versions 9 through 11. But IE 8 is definitely on the far side of browser history. It does not support
most of the features of ECMAScript 5. It does not include the API for W3C event handling. The list goes on
and on. So when we discuss modern browsers, we will refer to at least Internet Explorer 9. And our coverage
will not endeavor to support ancient browsers. Where relevant and simple, we will point out polyfills for
older versions of IE, but in general, our floor is Internet Explorer 9.
www.it-ebooks.info
Chapter 1 ■ Professional JavaScript Techniques
The standardization goes further than providing simple branching code. These libraries often
ameliorate buggy implementations. The official API for a function may not change much between versions,
but there will be bugs; sometimes those bugs will be fixed, sometimes not, and sometimes the fixes will
introduce new bugs. Where libraries could fix or work around these bugs, they did. For example, jQuery 1.11
contains more than a half-dozen fixes for problems with the event-handling API.
Some libraries (jQuery in particular) also provided new or different interpretations of certain
capabilities. The jQuery selector function, the core of the library, predates the now-standard
querySelector() and querySelectorAll() functions, and it was a driver for including those functions in
JavaScript. Other libraries provide access to functionality despite very different underlying implementations.
Later in the book, we will look at Ajax’s new Cross Origin Resource Sharing (CORS) protocol, which allows
for Ajax requests to servers other than the one that originally served the page. Some libraries have already
implemented a version of this that uses CORS but falls back to JSON with padding (JSON-P) where needed.
Because of their utility, some libraries have become part of a professional JavaScript programmer’s
standard development toolkit. Their features may not be standardized into JavaScript (yet), but they are an
accumulation of knowledge and functionality that simply makes it easier to realize designs quickly. In recent
years, though, you could get quite a few hits to your blog by asking whether jQuery (or another library) was
really necessary for development on a modern browser. Consider the BBC’s requirements; you can certainly
realize a large degree of jQuery-like functionality if you have those three methods available to you. But
jQuery also includes a simplified yet expanded DOM interface, it handles bugs for a variety of different edge
cases, and if you need support for IE 8 or earlier, jQuery is your major option. Accordingly, the professional
JavaScript programmer must look at the requirements for a project and consider whether it pays to risk
reinventing the wheel that jQuery (or another similar library) provides.
www.it-ebooks.info
Chapter 1 ■ Professional JavaScript Techniques
Coming Up Next
Starting with Chapter 2, we will look at the latest and greatest in the JavaScript language. This means looking
at new features like those available through the Object type, but also reexamining some older concepts like
references, functions, scope, and closures. We will lump all of this under the heading of Features, Functions,
and Objects, but it covers a bit more than that.
Chapter 3 discusses Creating Reusable Code. Chapter 2 skips over one of the biggest new features of
JavaScript, the Object.create() method, and its implications for object-oriented JavaScript code. So in this
chapter we will spend time with Object.create(), functional constructors, prototypes, and object-oriented
concepts as implemented in JavaScript.
Having spent two chapters developing code, we should start thinking about how to manage it. Chapter 4
shows you tools for Debugging JavaScript Code. We start by examining browsers and their developer tools.
www.it-ebooks.info
Chapter 1 ■ Professional JavaScript Techniques
Chapter 5 begins a sequence discussing some high-usage areas of JavaScript functionality. Here we look
at the Document Object Model. The DOM API has increased in complexity and has not really become more
straightforward since the last edition. But there are new features that we should familiarize ourselves with.
In Chapter 6, we attempt to master Events. The big news here is the standardization of the events API
along the lines of the W3C style. This provides us the opportunity to move away from utility libraries and
finally go deep into the events API without worrying about large variations between browsers.
One of the first non-toy applications for JavaScript was client-side form validation. Amazingly, it took
browser makers over a decade to think about adding functionality to form validation beyond capturing the
submit event. When looking in Chapter 7 at JavaScript and Form Validation, we will discover that there is a
whole new set of functionality for form validation provided by both HTML and JavaScript.
Everyone who develops with JavaScript has spent some time Introduction to Ajax. With the
introduction of Cross-Origin Resource Sharing (CORS), Ajax functionality has finally moved past the silliest
of its restrictions.
Command line tools like Yeoman, Bower, Git and Grunt are covered in Web Production Tools.
These tools will show us how to quickly add all the files and folders needed. This way we can focus on
development.
Chapter 10 covers AngularJS and Testing. Using the knowledge gained in the previous chapter, we now
start to look at what makes Angular work and how to implement both unit and end to end testing.
Last, Chapter 11 discusses the Future of JavaScript. ECMAScript 6 will be settled, more or less, by the
time this book goes to press. ECMAScript 7 is in active development. Beyond the basics of where JavaScript
is going, we will look at what features you can use right now.
Summary
We spent a lot of this chapter on everything around JavaScript: the platform(s), the history, the IDEs, and so on.
We believe that history informs the present. We wanted to explain where we were, and how we got here, to
help you understand why JavaScript is where it is, and is what it is, today. Of course, we plan to spend the
bulk of this book talking about how JavaScript works, particularly for the professional programmer. We feel
quite strongly that this book covers the techniques and APIs that every professional JavaScript programmer
should be familiar with. So without further ado…
www.it-ebooks.info
Chapter 2
Objects are the fundamental units of JavaScript. Virtually everything in JavaScript is an object and interacts
on an object-oriented level. To build up this solid object-oriented language, JavaScript includes an arsenal of
features that make it unique in both its foundation and its capabilities.
This chapter covers some of the most important aspects of the JavaScript language, such as references,
scope, closures, and context. These are not necessarily the cornerstones of the language, but the elegant
arches, which both support and refine JavaScript. We will delve into the tools available for working with
objects as data structures. A dive into the nature of object-oriented JavaScript follows, including a discussion
of classes vs. prototypes. Finally, the chapter explores the use of object-oriented JavaScript, including exactly
how objects behave and how to create new ones. This is quite possibly the most important chapter in this
book if taken to heart, as it will completely change the way you look at JavaScript as a language.
Language Features
JavaScript has a number of features that are fundamental to making the language what it is. There are very
few other languages like it. We find the combination of features to fit just right, contributing to a deceptively
powerful language.
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
// This change goes both ways, since obj and refToObj are both references
refToObj.anotherProperty = 1;
console.log( obj.anotherProperty === refToObj.anotherProperty );
Objects have two features: properties and methods. These are often referred to collectively as the
members of an object. Properties contain the data of an object. Properties can be primitives or objects
themselves. Methods are functions that act upon the data of an object. In some discussions of JavaScript,
methods are included in the set of properties. But the distinction is often useful.
Self-modifying objects are very rare in JavaScript. Let’s look at one popular instance where this occurs.
The Array object is able to add additional items to itself using the push method. Since, at the core of an Array
object, the values are stored as object properties, the result is a situation similar to that shown in Listing 2-1,
where an object becomes globally modified (resulting in multiple variables’ contents being simultaneously
changed). An example of this situation can be found in Listing 2-2.
It’s important to remember that references point only to the referent object, not to another reference.
In Perl, for example, it’s possible to have a reference point to another variable that also is a reference. In
JavaScript, however, it traverses down the reference chain and only points to the core object. An example of
this situation can be seen in Listing 2-3, where the physical object is changed but the reference continues to
point back to the old object.
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
Finally, let’s look at a strange instance that you might think would involve references but does not.
When performing string concatenation, the result is always a new string object rather than a modified
version of the original string. Because strings (like numbers and Booleans) are primitives, they are not
actually referents, and the variables that contain them are not references. This can be seen in Listing 2-4.
Listing 2-4. Example of Object Modification Resulting in a New Object, Not a Self-Modified Object
// Set item equal to a new string object
var item = 'test';
Strings are often particularly confusing because they act like objects. You can create instances of strings
via a call to new String. Strings have properties like length. Strings also have methods like indexOf and
toUpperCase. But when interacting with variables or functions, strings are very much primitives.
References can be a tricky subject to wrap your mind around, if you are new to them. Nonetheless,
understanding how references work is paramount to writing good, clean JavaScript code. In the next couple
of sections we’re going to look at features that aren’t necessarily new or exciting but are important for writing
good, clean code.
Scope
Scope is a tricky feature of JavaScript. Most programming languages have some form of scope; the
differences lie in the duration of that scope. There are only two scopes in JavaScript: functional scope and
global scope. This is deceptively simple. Functions have their own scope, but blocks (such as while, if, and
for statements) do not. This may seem strange if you are coming from a block-scoped language. Listing 2-5
shows an example of the implications of function-scoped code.
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
// Within an if block
if ( true ) {
// Set foo equal to 'new test'
// NOTE: This still belongs to the global scope!
var foo = 'new test';
}
You’ll notice that in Listing 2-5, the variables are within the global scope. All globally scoped variables
are actually visible as properties of the window object in browser-based JavaScript. In other environments,
there will be a global context to which all globally-scoped variables belong.
In Listing 2-6 a value is assigned to a variable, foo, within the scope of the test() function. However,
nowhere in Listing 2-6 is the scope of the variable actually declared (using var foo). When the foo variable
isn’t explicitly scoped, it will become defined globally, even though it is only intended to be used within the
context of the function.
10
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
JavaScript’s scoping is often a source of confusion. If you are coming from a block-scoped language, this
confusion can lead to accidentally global variables, as shown here. Often, this confusion is compounded
by imprecise usage of the var keyword. For simplicity’s sake, the pro JavaScript programmer should always
initialize variables with var, regardless of scope. This way, your variables will have the scope you expected,
and you can avoid accidental globals.
When declaring variables within a function, be aware of the issue of hoisting. Any variable declared
within a function has its declaration (not the value it is initialized with) hoisted to the top of the scope.
JavaScript does this to ensure that the variable’s name is available throughout the scope.
Especially when we combine scope with the concept of context and closures, discussed in the next two
sections, JavaScript reveals itself as a powerful scripting language.
Context
Your code will always have some form of context (a scope within which the code is operating). Context can
be a powerful tool and is essential for object-oriented code. It is a common feature of other languages, but
JavaScript, as is often the case, has a subtly different take on it.
You access context through the variable this, which will always refer to the context that the code is running
inside. Recall that global objects are actually properties of the window object. This means that even in a global
context, this will still refer to an object. Listing 2-7 shows some simple examples of working with context.
Listing 2-7. Examples of Using Functions Within Context and Then Switching Context to Another Variable
function setFoo(fooInput) {
this.foo = fooInput;
}
var foo = 5;
console.log( 'foo at the window level is set to: ' + foo );
var obj = {
foo : 10
};
In Listing 2-7, our setFoo function looks a bit odd. We do not typically use this inside a generic utility
function. Knowing that we were eventually going to attach setFoo to obj, we used this so we could access
the context of obj. However, this approach is not strictly necessary. JavaScript has two methods that allow
you to run a function in an arbitrary, specified context. Listing 2-8 shows the two methods, call and apply,
that can be used to achieve just that.
11
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
setBodyColor('black' );
While the usefulness of context may not be immediately apparent, it will become clearer when we look
at object orientation soon.
Closures
Closures are a means through which an inner function can refer to the variables present in its outer
enclosing function after its parent functions have already terminated. That’s the technical definition,
anyway. Perhaps it is more useful to think of closures tied to contexts. Up to this point, when we have
defined an object literal, that object was open for modification. We have seen that we can add properties and
functions to the object at any time. But what if we wanted a context that was locked? A context that “saved”
values as defaults. What about a context that could not be accessed without the API we provide? This is what
a closure provides: a context that is accessible only in the manner we choose.
This topic can be very powerful and very complex. We highly recommend referring to the sites
mentioned at the end of this section, as they have some excellent information about closures.
Let’s begin by looking at two simple examples of closures, shown in Listing 2-9.
12
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
Listing 2-9. Two Examples of How Closures Can Improve the Clarity of Your Code
// Find the element with an ID of 'main'
var obj = document.getElementById('main');
The first function call to setTimeout shows an instance where new JavaScript developers often have
problems. It’s not uncommon to see code like this in a new developer’s program:
setTimeout('otherFunction()', 1000);
or even...
In both examples, the functions being called are expressed as strings. This can cause problems with the
minification process when you are about to move your code into production. By using closures, you can call
functions, use variables, and pass parameters as originally intended.
Using the concept of closures, it’s entirely possible to circumnavigate this mess of code. The first
example in Listing 2-9 is simple; there is a setTimeout callback being called 1,000 milliseconds after it is first
called, but still referring to the obj variable (which is defined globally as the element with an ID of main). The
second function defined, delayedAlert, shows a solution to the setTimeout mess that occurs, along with the
ability to have closures within function scope.
You should find that when using simple closures such as these in your code, the clarity of what you’re
writing increases instead of turning into a syntactical soup.
Let’s look at a fun side effect of what’s possible with closures. In some functional programming
languages, there’s the concept of currying, a way to prefill a number of arguments to a function, creating a
new, simpler function. Listing 2-10 has a simple example of currying, creating a new function that prefills an
argument to another function.
13
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
}
// addFive now contains a function that takes one argument,
// adds five to it, and returns the resulting number
var addFive = addGenerator( 5 );
There’s another common JavaScript-coding problem that closures can solve. New JavaScript developers
often accidentally leave a lot of extra variables sitting in the global scope. This is generally considered bad
practice, as those extra variables could quietly interfere with other libraries, causing confusing problems
to occur. Using a self-executing anonymous function, you can essentially hide all normally global variables
from being seen by other code, as shown in Listing 2-11.
Listing 2-11. Example of Using Anonymous Functions to Hide Variables from the Global Scope
// Create a new anonymous function, to use as a wrapper
(function(){
// The variable that would normally be global
var msg = 'Thanks for visiting! ';
Finally, let’s look at one problem that occurs with closures. Remember that a closure allows you to
reference variables that exist within the parent function. However, it does not provide the value of the variable
at the time it is created; it provides the last value of the variable within the parent function. You’ll most
commonly see this occur during a for loop. There is one variable being used as the iterator (i). Inside the
for loop, new functions are being created that utilize the closure to reference the iterator again. The problem
is that by the time the new closured functions are called, they will reference the last value of the iterator (that
is, the last position in an array), not the value that you would expect. Listing 2-12 shows an example of using
anonymous functions to induce scope, to create an instance where expected closure is possible.
14
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
Listing 2-12. Example of Using Anonymous Functions to Induce the Scope Needed to Create Multiple
Closure-Using Functions
// An element with an ID of main
var obj = document.getElementById('main');
We will return to closures in our section on object-oriented code, where they will help us to implement
private properties.
The concept of closures is not a simple one to grasp; it took us a lot of time and effort to truly wrap
our minds around how powerful closures are. Luckily, there are some excellent resources explaining how
closures work in JavaScript: “JavaScript Closures” by Richard Cornford, at http://jibbering.com/faq/faq_
notes/closures.html, and another explanation at the Mozilla Developer Network, https://developer.
mozilla.org/en-US/docs/Web/JavaScript/Closures.
15
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
You may wonder if there is a way to have the full functionality of an array available to the arguments
object. It is not possible with arguments itself, but it is possible to create a copy of arguments that is an array.
By invoking the slice method from the Array prototype, we can quickly copy the arguments object into an
array, as in Listing 2-14.
We will learn more about the prototype property very soon. For the moment, suffice it to say that the
prototype allows us to access object methods in a static manner.
What if the message were not defined? We need to be able to check not just for the presence of an
argument, but also its absence. We can take advantage of the fact that any argument that isn’t provided has
a value of undefined. Listing 2-15 shows a simple function for displaying an error message and providing
a default message if a particular argument is not provided. (Note that we must use typeof here, because
otherwise, an argument with the literal string “undefined” would indicate an error.)
16
www.it-ebooks.info
Chapter 2 ■ Features, Functions, and Objects
displayError();
The use of the typeof statement helps to lead us into the topic of type-checking. Because JavaScript is a
dynamically typed language, this proves to be a very useful and important topic. There are a number of ways
to check the type of a variable; we’re going to look at two that are particularly useful.
The first way of checking the type of an object is by using the obvious-sounding typeof operator. This
utility gives us a string name representing the type of the contents of a variable. An example of this method
can be seen in Listing 2-16.
The advantage of typeof is that you do not have to know what the actual type of the tested variable is.
This would be the perfect solution except that for variables of type Object or Array, or a custom object such
as User, typeof only returns “object”, making it hard to differentiate between specific object types. The next
two ways to figure out the type of a variable require you to test against a specific existing type.
The second way to check the type of an object is to use the instanceof operator. This operator checks
the left operand against the constructor of the right operand, which may sound a bit more complex than it
actually is! Take a look at Listing 2-17, showing an example of using instanceof.
17
www.it-ebooks.info
Discovering Diverse Content Through
Random Scribd Documents
haren lateren bloei en welvaart, werd het Fort Sommelsdijk aan de
samenvloeiing van de Commewijne en de Cottica aangelegd, en werd
een einde gemaakt aan de herhaalde invallen der Indianen, die hij in
1684 tot den vrede dwong. Meer dan eens, zegt J. R. Thomson, in zijn
Overzicht der Geschiedenis van Suriname, trok hij aan het hoofd van
een geringe krijgsmacht tegen de vijandige Indianen op. Op zijn
tweeden tocht ging hij met drie vaartuigen over zee naar de
Coppename en drong hij het binnenland in, waarbij vele Indianen
gedood of gevangen werden genomen en ettelijke dorpen in de asch
werden gelegd.
Reeds vóór zijn komst, onder het Engelsche Bestuur, waren vele
slaven wegens de mishandelingen, die zij van hun blanke meesters
hadden te verduren, naar de bosschen gevlucht. Van Sommelsdijk
sloot in genoemd jaar ook met de Boschnegers van de Coppename
vrede.
Het besluit tot zulk een gemeenschappelijken strijd woonde o.a. een
der eerste missionarissen der Moravische [62]Broedergemeente
(Herrnhuttergemeente) bij, die in April 1745 aan de Corantijn kwam. Er
werd toen door de Caraïben en Arowakken aldaar een groote raad
inhouden, waarbij de voornaamste hoofdmannen (kapiteins)
tegenwoordig waren en waarop besloten werd, tegen de Spaansche
Indianen van het Orinoco-gebied op te trekken. In 18–20 vaartuigen
voeren zij naar de Orinoco en zij brachten 14 dagen op het water en 8
dagen op het land door. Eindelijk bereikten zij de vijandelijke kampen.
Aanvankelijk gedroegen zij zich als vrienden, hun allerlei ruilmiddelen
aanbiedend, maar plotseling overvielen zij hen, doodden zij de mannen
en namen zij de vrouwen en kinderen als gevangenen mede. Iedere
overwinnaar nam een verslagen vijand, sneedt hem het vleesch af, dat
in het eerstvolgende nachtkwartier geroosterd en opgegeten werd.
[64]
Mogen ook zij, die dit voorrecht niet gekend hebben, zich bij dit oordeel
hartgrondig aansluiten, wanneer hun geest zich in dezen bundel
gelaafd zal hebben aan het vele schoone, dat de Indianen-ziel siert, en
waarvan hunne mondelinge overleveringen zoo herhaaldelijk
getuigenis afleggen; en mogen de voorbeelden, die ik uit de rijke
litteratuur over den Indiaan voor deze Mythen- en Legenden-serie heb
gekozen, ook den lezers iets van de groote bekoring hebben laten
gevoelen, die niet alleen van het leven en de moraal van den Indiaan,
maar ook van de machtige natuur der maagdelijke wouden, te midden
waarvan de Zuid-Amerikaansche stammen nog leven, in zoo hooge
mate uitgaat! [66]
[Inhoud]
Indianen-Vertellingen.
Den volgenden dag, toen zij naar haar werk terug keerden, vonden zij
het meel reeds gereed liggen. Hoe dat zoo kwam, konden zij maar niet
ontdekken. Den volgenden dag—precies hetzelfde; het meel lag voor
haar gereed. Daar ze er het fijne van wilden weten, besloten zij de
nacht bij den boom door te brengen en goed op te letten. Toen het
middernacht was, konden zij hare oogen niet gelooven, toen zij zagen,
dat een blad van een nabijstaanden Palissadepalm* zich voorover
boog, totdat het de snede, die zij in den op den grond liggenden Ita-
stam hadden gemaakt, raakte. Nauwelijks hadden de vrouwen de
aanraking gezien, of zij stoven naar voren, grepen het zoo geheimzinnig
doende blad beet, en smeekten het vurig, zich in een man te willen
veranderen. Eerst weigerde het; maar toen ze aandrongen, ziet, toen
gebeurde het wonder.
De man, die zij vóór zich zagen, zei, Mayara-Koto te heeten. De oudste
zuster, die hij tot zich nam, was nu overgelukkig, want eenigen tijd
daarna schonk zij hem een prachtigen jongen. Haboeri was zijn naam.
De beide vrouwen, die gewoon waren, in de nabijheid van twee
swampen* te jagen, vonden in de eene, die haar eigendom was, steeds
rijkelijk visch. De andere behoorde [67]echter aan Tijger* en daarom
waarschuwden zij Mayara-Koto, niet in Tijger’s swamp te gaan
visschen. De man luisterde echter niet. „In onze swamp is te weinig
visch”, zei hij, „in die van Tijger is er overvloed. Ik ga zien, wat ik vang.”
Maar nauwelijks was hij begonnen, of Tijger kwam voorbij, greep hem
en velde hem met één slag neêr.
Hoewel de stem den vrouwen niet beviel, voldeden zij aan zijn
verlangen. „Breng de visch binnen, en maak ze klaar. Ik ga nu slapen
en stoor mij niet.” Toen de vrouwen met de visch gereed waren, en
reeds begonnen te eten, was de man in zóó diepen slaap gevallen en
zóó hard aan het snorken gegaan, dat men het wel aan den anderen
rivieroever had kunnen hooren. Verbaasd zagen de beide vrouwen
elkander aan, toen zij tusschen het snorken door vader’s naam,
Mayara-Koto, hoorden roepen. „Onze man heeft vroeger nooit zoo
gesnorkt; nooit hebben wij hem zijn eigen naam hooren noemen”, zei
de oudste. Zij begonnen steeds angstiger te worden en konden
nauwelijks verder eten, want het was toch niet mogelijk, dat het haar
man was, die in de hangmat lag.
„Wat moeten we met Haboeri doen; hoe moeten we hem uit de armen
van den vreemden man bevrijden”, [68]zeiden ze tegelijk. „Ik heb een
idee”, riep de jongste, „we zullen een bundel vezels en bastrepen bij
elkander binden, en dezen onder Haboeri schuiven; daarna zullen we
hem voorzichtig wegnemen”. Zoo gezegd, zoo gedaan. Met Haboeri
onder den arm namen de beide vrouwen haastig de vlucht, na gezorgd
te hebben het noodige mede te nemen, om vuur te kunnen maken.
Inmiddels was Tijger wakker geworden, en toen hij zag, dat in plaats
van Haboeri, een bundel vezels en bast in zijn armen lag, en bemerkte,
dat de beide vrouwen gevlogen waren, werd hij zóó woedend, dat hij uit
de hangmat sprong, en na weder de tijgergedaante te hebben
aangenomen, de achtervolging begon. Maar de vluchtelingen hadden
de hut van de piai-vrouw reeds bereikt. „Wau-oeta, doe de deur open 28,
riepen zij. „Wie is daar”, antwoordde Wau-oeta. „Wij zijn het, de twee
zusters”, riepen de achtervolgden. Maar Wau-oeta deed niet open. Toen
kneep de moeder in Haboeri’s oor, zoodat het kind hard begon te
schreeuwen. „Wat is dat voor een kind, een jongen of een meisje”,
vroeg toen Wau-oeta. „Het is mijn Haboeri, mijn jongen”, antwoordde
zijn moeder, en onmiddellijk deed Wau-oeta nu open, verheugd
uitroepende: „Kom binnen, kom binnen.”
Toen zij een klein eind op weg waren, zei Wau-oeta nog even terug te
moeten; ze zou dadelijk terugkomen, [70]en van dat oogenblik maakte
Wau-oeta gebruik, om Haboeri te vertellen, dat zij zijn moeder was, en
lichtte hem in, hoe hij zich tegenover haar moest gedragen.
Haboeri was in dien tijd een kranig schutter geworden; geen vogel
ontsnapte aan zijn pijlen. Wau-oeta daarmeê zeer ingenomen, gelastte
Haboeri, in het vervolg alle vogels, die hij zou dooden, aan haar te
geven, en de kleinere, na ze vooraf ongenietbaar te hebben gemaakt,
aan de beide zusters. Zij hoopte, dat deze eindelijk er genoeg van
zouden krijgen en ten slotte de hut zouden verlaten. Maar zij waren er
niet toe te bewegen en gaven hare pogingen, om Haboeri te vinden,
niet op.
Dagen achtereen ging dit zoo zijn gang. Wau-oeta kreeg de groote
vogels, de kleinere bleven voor moeder en tante, tot eens op een dag
een pijl van Haboeri niet raakte en aan een over een kreek hangenden
tak bleef hangen, op een plek, waar zijn ooms, de waterhonden*,
gewoon waren, voedsel te komen zoeken.
Het was een mooie open plek in het bosch en Haboeri maakte het zich
gemakkelijk, na het achtergelaten vuil der dieren met bladeren te
hebben bedekt. Hij klom in den boom, om zijn pijl vrij te maken, toen op
het zelfde oogenblik de otters aan kwamen zwemmen. Nauwelijks
aangekomen, snoven ze de lucht op en riepen tegelijk: „Wat ruik ik
daar? Het is stellig onze neef Haboeri, die hier dichtbij moet zijn”.
Overal keken ze rond en eindelijk ontdekten ze hem op den tak. „Kom
beneden”, riepen zij, „en zet je op deze zandbank neêr”.
Haboeri voldeed aan het verzoek, en de otters legden hem toen uit, dat
hij een slecht leven leidde, want dat de oude vrouw zijn moeder niet
was, doch de beide jongere vrouwen zijn moeder en tante waren, en
het dus zeer slecht van hem was, de vogels zóó te verdeelen; dat hij in
het vervolg juist de kleinsten aan de oude vrouw moest [71]geven. Zij
beduidde hem, dat hij aan zijn ware moeder moest vertellen, dat hij
tegenover haar verkeerd gehandeld had, dat hij onwetend was en er
spijt van had.
Toen Haboeri dien dag thuis kwam, volgde hij de bevelen der otters op,
en ontving de ware moeder de groote vogels. Zij van haar kant voelde
zich dien dag vreemd te moede; het was haar moeielijk, den jongen
man dadelijk als haar zoon aan te spreken. Maar toen deze haar
uitlegde, dat Wau-oeta hem in zóó korten tijd tot een man had gemaakt,
geloofde zij hem, en voelde zich geheel opgebeurd. De oude Wau-oeta,
dit alles hoorende, wond zich zoodanig op, dat zij, Haboeri bij den nek
pakkend, hem in het gezicht blies. Zóó was zij van streek, dat zij den
geheelen dag niet kon eten. Dag en nacht plaagde zij Haboeri en ieder
oogenblik riep zij, dat hij zijn zinnen verloren had.
Haboeri, ten einde raad, vatte het plan op, de hut te verlaten, en haalde
zijn moeder over, zoo spoedig mogelijk met hem en zijn tante te
vluchten. Te dien einde maakte hij een kleine korjaal van bijenwas
gereed, en toen hij daarmede gereed was, liet hij hem aan den
waterkant. Toen hij echter den anderen dag terugkwam, had een zwarte
eend het vaartuig weggenomen. Hij maakte toen een nieuwe korjaal,
ditmaal van klei, maar deze werd door een andere eend gestolen.
Haboeri kapte toen een groot terrein open en hij deed het zóó gauw, dat
de vrouwen hem met het planten van cassave haast niet bij konden
houden. Zoo hadden zij volop cassave voor de voorgenomen reis.
Haboeri was het dus, die het eerst een boot maakte en aan de eenden
leerde, aan de oppervlakte van het water te zwemmen, omdat het met
zijn booten was, dat zij het klaar speelden. Inderdaad, wij, Warraus
zeggen, dat iedere eendsoort een bepaalde boot heeft.
Maar wat nog vreemder was, de laatst gemaakte boot, die niet gestolen
was, was den volgenden dag veel grooter geworden. Haboeri bracht de
heuchelijke tijding dadelijk aan zijn moeder en tante, en verzocht haar,
alle provisie, die ze van het land konden halen, voor de lange reis in de
boot te brengen. Hij begaf zich zelf naar het veld, om er de cassave-
stekken te brengen, die de oude Wau-oeta in de gereedgemaakte gaten
moest steken, en zoo gingen zij nog een tijd met hard werken voort.
Toen alles voor de reis gereed was, begaf Haboeri zich naar de hut,
nam pijl en boog, en steenen bijl* en keerde met zijn wapens en
gereedschap naar de waterkant terug. Maar te voren drukte hij de
posten of hutpalen op het hart—want in vroeger dagen konden deze
spreken 29, zoodat bij afwezigheid van den eigenaar, een vreemde
bezoeker kon te weten komen, waar hij was—vooral niets te vertellen.
Maar er was een papegaai in de hut, en Haboeri vergat ook hem in te
lichten en het zwijgen op te leggen.
Zoo kwam het, dat, toen de oude Wau-oeta, zich eenzaam en verlaten
voelende, en bemerkende dat Haboeri verdwenen was, aan de posten
vroeg, waar hij gebleven was. Deze antwoordden echter niet, maar de
papegaai kon het niet helpen, dat hij begon te spreken en haar inlichtte.
Onmiddellijk ijlde Wau-oeta naar de landingsplaats, en zij kwam nog
juist bij tijds, toen Haboeri op het punt was, in de korjaal te stappen en
met zijn moeder en tante weg te parelen. Zij greep de boot en
jammerde: „Mijn zoon, mijn zoon, je moogt me niet verlaten. Ik [73]ben je
moeder” en niettegenstaande Haboeri met zijn parel hare vingers bijna
tegen het dolboord stuk sloeg, wilde zij niet loslaten. Arme Haboeri zag
zich dus genoodzaakt aan land te gaan, waar hij de oude Wau-oeta bij
een hollen boom bracht, waarin bijen genesteld waren. Haboeri velde
den stam en drong er op aan, dat zij er in zou kruipen, om de honig,
waarvan zij zooveel hield, te verzamelen. En Wau-oeta, al maar
schreiende bij de gedachte, Haboeri te zullen verliezen, kroop naar
binnen, waarna Haboeri onmiddellijk de opening sloot.
… en niettegenstaande Haboeri met zijn parel hare vingers
bijna tegen het dolboord stuk sloeg …—Zie blz. 73.
Deze geschiedenis van den mythischen Haboeri, die een nationale held
der Warraus is, geeft onder de vele voorstellingen omtrent het ontstaan
van menschen, en het verband tusschen menschen en dieren, ook een
verklaring voor de bekende kundigheid der Warraus, om de
voortreffelijkste booten te maken.
De bewoners van den hemel gluurden eens door een opening, die zij,
zooals hen geleerd was, niet mochten naderen, naar beneden, en
ontdekten toen een geheel andere wereld. Zij sneden toen lange
[74]bastrepen en lieten zich er mede naar beneden zakken.
Toen zij nu een tijd lang op de aarde hadden rondgedoold, begonnen zij
angstig te worden en besloten zij weder naar boven te klimmen. Nadat
zij nu weder de opening, waaruit zij waren neêrgedaald, hadden bereikt,
bleef een vrouw, die buitengewoon breed en zwaar was, in het gat
steken en gedurende het gevecht en het gedrang, dat er ontstond, om
binnen te komen, brak de bastreep af en een aantal Caraïben vielen
naar beneden en waren nu genoodzaakt op de aarde te blijven.
Toen zij echter geen eten konden vinden, dat naar hun smaak was,
zagen zij zich genoodzaakt, aarde te eten, waarvan zij koeken bakten.
Zij begonnen echter hoe langer hoe magerder te worden, en toen zij
bemerkten, dat de Acouri* er zoo welgedaan uitzag, zetten zij een
Specht* op den uitkijk, om te weten te komen, op welke wijze de Acouri
zich voedsel verschafte. Maar de specht verried zichzelf door zijn getik
tegen den stam, toen het kleine dier naar buiten kwam. Zij droegen nu
den Alligator* op, om het te bespieden; deze keerde terug, maar
vertelde een leugen. Na hem daarvoor gestraft te hebben, door zijn
tong uit te snijden 30, zonden zij er een rat op uit; doch deze keerde niet
terug en het volk moest hongerlijden. [75]
Verlangend om ook eens van die dieren, die hij niet kende, te proeven,
was hij zoo gelukkig een jong hert te schieten, waarvan hij het vleesch
braadde; en zóó lekker smaakte hem dit, dat hij besloot er mede weder
aan den katoenen band naar boven te klimmen. Alle Warraus waren nu
natuurlijk verlangend, om Okonoróté naar beneden te vergezellen, toen
hij zijn tocht naar de aarde wilde herhalen.
Toen nu de laatsten door het gat wilden zien te komen, gebeurde het,
dat een buitengewoon dikke vrouw in het [76]gat niet heen weêr kon
komen, en daar moest blijven, zoodat de Warraus genoodzaakt waren,
altijd op de aarde te blijven.
Dit had zoo een poos geduurd, toen een jonge camoedi geboren werd.
Het jong vertoonde zich nu en dan op een zandbank, zwom in het water
heen en weêr en keerde daarna weder naar het nest terug.
Toen het meisje zoo lang wegbleef, zei de vader tot zijn beide zoons:
„Wat is er toch met jelui zuster. Waarom blijft zij zoo lang in het bad?”
Daar de zoons er ook niets van begrepen, werd overeengekomen, dat
zij naar den rivieroever zouden gaan om haar te bespieden. En wat
zagen zij? Hun zuster in teedere omarming met een waterboa en in de
nabijheid van het verliefde paar een jonge camoedi. Zij bleven kijken en
zagen, dat de oude camoedi aan zijn jong eten bracht.
Bij de eerste goede gelegenheid deden ze wat hen bevolen was. Zij
doodden den oude en sleepten het jong naar het achterliggende bosch,
waar zij het in een menigte stukjes sneden.
Eenige maanden later, toen zij in den omtrek aan het jagen waren,
hoorden de broêrs een groot lawaai en het [77]geluid van een menigte
stemmen, dat van de plek scheen te komen, waar zij de jonge camoedi
gedood hadden; en toen zij zich in de richting begaven, van waar de
stemmen kwamen, zagen zij juist op de plek, waar zij de jonge slang in
stukken hadden gesneden, vier hutten, elk bewoond door Indianen, die
uit de stukken van de jonge camoedi te voorschijn gekomen waren.
In de voorste hut zei de oudste der bewoners tot de broêrs, dat hij
verheugd was, hen als hun ooms te kunnen verwelkomen; maar in de
andere drie wilden de Indianen hen dooden, omdat zij het kind van hun
zuster, waaruit zij geboren waren, gedood hadden. Maar de Indiaan uit
de voorste hut zei: „neen, doe dat niet, want deze twee bezoekers zijn
immers jelui ooms, en jelui moet hen daarom genegen zijn.”
En zoo gebeurde het, dat de beide broêrs onverlet bij hun ouden vader
kwamen, wien zij vertelden, dat uit de deelen van de stuk gesneden
jonge camoedi menschen waren gegroeid.
Er was een tijd, dat de Indianen geen cassave hadden en dat zij allen
honger leden. Ook de dieren hadden weinig te eten en leden honger.
Alleen Maipoeri* ging geregeld iederen morgen er op uit en ’s avonds
kwam hij glimmend van gezondheid en vet van zijn tochten terug. De
andere dieren die de overblijfselen van zijn maal—[78]bananenschillen,
suikerrietresten, enz.—zagen liggen, zeiden tegen elkander: „Maipoeri
moet zeker een goede plaats gevonden hebben, waar hij eten vindt.
Laten we hem volgen”. Alzoo zonden zij er den volgenden morgen de
Boschrat* op uit, die hem op de hielen zou volgen. Zoo hoorden zij, op
welke wijze hij er zoo lekker doorvoed uitzag. Want toen de boschrat
deed, wat hem was opgedragen, en Maipoeri ver in het bosch volgde,
zag zij hem eindelijk onder een enormen boom halt houden en de
vruchten oprapen, die naar beneden waren gevallen.
Zoodra nu Maipoeri zijn maag gevuld had, klom de rat in den boom,
verzadigde zij zich aan maïs en toen zij niet meer kon, daalde zij weêr
naar beneden, een korrel meebrengend om haar lotgenooten te laten
zien, wat zij gevonden had.
Zij maakten een stellage om den stam en begonnen met hun steenen
bijlen* den boom te bewerken. Tien dagen bleven ze hakken, maar hij
wilde maar niet vallen—zoo’n kolos was Allepántepo. Nog eens tien
dagen gingen ze er meê voort, en nog hadden ze hem niet naar
beneden. [79]
Maipoeri keerde na eenigen tijd van den rivieroever terug en toen hij
zag, dat voor hem alleen de pruimen* waren overgebleven, was hij zeer
vertoornd. Nog altijd moet de Tapir voor zijn inhaligheid boeten; want hij
moet zich nog steeds daarmede tevreden stellen.
De dochter van een piaiman werd tot over de ooren verliefd op een
dapperen, jongen jager; maar deze nam weinig notitie van het meisje.
Zij wendde zich nu tot haar vader, en klaagde hem haar nood, er bij
voegende, dat [80]de jonge man toch een vrouw diende te hebben, die
hem bij zijn thuiskomst kon verzorgen. Het meisje smeekte nu haar
vader, om van haar een van ’s mans honden te maken, zoodat zij altijd
bij hem zou kunnen zijn.
„Neem dit vel”, zei de vader, „en hang het over je schouders. Wees
bevrijd van je dolzinnigheid, en—kom weêr bij je vader terug.” Het
meisje veranderde nu in een hond. Telkens, wanneer nu de jonge man
met vier honden op jacht was, rende er altijd een in den namiddag weg,
die niet langer aan den strijd wilde deelnemen—en wat vreemder was,
als de jager in zijn hut terugkeerde, vond hij het vuur branden, zijn
cassavebrood gebakken, en alles netjes en helder.
De man dacht, dat hij dit alles aan een van zijn buren te danken had,
wien hij daarom een bezoek ging brengen, om voor de zorg te
bedanken. Maar niemand wist iets van het geval. „Het mag dan
misschien een of andere Geest geweest zijn, die medelijden met mijn
eenzaamheid heeft gehad,” gaf hij ten antwoord. Toen hij deze woorden
sprak, zag een zijner honden hem zoo vreemd aan, alsof hij zeggen
wilde: „ik weet er ook niets van.” De man begon nu over het geval te
piekeren.
Den volgenden dag, toen hij weêr op jacht was, telde hij zijn honden en
bemerkte hij, dat er maar drie waren, „Ik ga toch eens zien, wat jelui
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com