One page: Javascript in 10 minutes
javascript.infogami.com
javascript.infogami.com
Also, the author should probably put something at the top stating who the introduction is intended for. It is clear to me that it is not for newbie programmers, but that would not be clear to the actual newbie.
A beginner could very well set out thinking that this is the perfect introduction to programming for them. And then in the first paragraph discover the semantically very rich phrase "Javascript is a dynamically typed language". To a programmer that is valuable information but to the beginner it just confusing.
The best method of teaching, in my experience, is to start with the fundamentals (a skeleton model at a high level of abstraction) even if it's not fully accurate and then fill in the details and all of the cautionary advice bit by bit, building up the skeleton model into a more robust and full featured model.
Love that Simpson quote, "Boy-Scoutz 'n the Hood" S5E8 ~ http://en.wikipedia.org/wiki/Boy-Scoutz_%27n_the_Hood
http://brammoblog.files.wordpress.com/2010/10/donny_dont_22....
Property Maps
var emptyMap = {};
In JavaScript, these are called Objects. I don't think it's right for them to be called "property maps" in a tutorial like this.The heading called "Objects" should be renamed something like "Constructors" too.
Also, using
for (var i in array)
is not the preferred way of iterating over an array (the for construct does not guarantee ordering).traditional for loops incrementing until length is reached are preferable for arrays (personal style: for(var i=0,l=array.length ; i<l ; i++))
For objects, for...in with a hasOwnProperty check is preferred, I think (if you're going to be iterating over objects that is, which usually means you're using an object as a textually-indexed array, which isn't that great).
Over all a nice introduction though.
using an object as a textually-indexed array,
which isn't that great
Using it as a hash table is just fine.I mean if you're going to want to iterate over it, you should probably be using an array instead.
Another quick-ish intro.
Javascript for people who are in a hurry:
http://kaijaeger.com/javascript-for-people-who-are-in-a-hurr...
Javascript for people who are in slightly less of a a hurry:
http://kaijaeger.com/articles/javascript-for-people-who-are-...
(Despite this, it does have some functions for converting and parsing integral values.)
Ecmascript 4 (abandoned) had some support for an Integer type (it was a kind-of pseudo-type mess where the value of a Number was checked to see if it was an integer or not).
This propertyMap-thing for objects is scary, though.