
A re-introduction to JavaScript - rajesht
https://developer.mozilla.org/en/a_re-introduction_to_javascript
======
ams6110
Glad to see they linked Crockford's site. I discovered his site probably four
years ago or so and it really opened my eyes to the capabilities of the
language. I think anyone who wants to learn more about JavaScript should
definitely include Crockford in his studies.

------
aborovoy
Question to JavaScript gurus: how would i know if my code works in various
browserless environments like Reeno and V8? Is there a compatibility table of
various JS features is isn't browser-centric?

Thanks!

~~~
tlrobinson
Get "JavaScript: The Definitive Guide" and look at the API reference, it's
split into two sections, one for APIs provided with every JavaScript
implemetation, and one for APIs provided by browsers.

Currently there's not much compatibility between server-side JavaScript
platforms (beyond the minimal set of APIs provided by the language
implementations), something we're trying to solve with CommonJS, but that
effort has been inhibited by node.js's sudden rise in popularity and refusal
to work with CommonJS...

~~~
micrypt
"refusal to work with CommonJS..." I thought this was a thing of past. Node.js
is listed on the CommonJS website: <http://www.commonjs.org/impl/>

~~~
tlrobinson
Node has CommonJS modules, which is a good start, but that's it.

------
csallen
Just a heads up, article was last significantly edited in March '06.

~~~
sloniks
What has changed since then?

~~~
jackmoore
My only qualm is that it gives advice on how to use arguments.callee, which
was depreciated in ECMAScript 5, for recursive anonymous functions.

Since they already give an example of how to use a named function recursively,
the arguments.callee example could just simply be removed.

------
AlexMuir
I've been using Javascript for years and never really 'learned it'. It's just
something I've dipped into to solve a particular problem - largely through
just grabbing other code/dissecting existing stuff. Then I got hold of jQuery
and never learned about the underlying language. This was great to catch up on
the basics.

------
andrew-bor
Despite hundreds of thousands of search results in Google when you're looking
for "Javascript tutorial" this one is by far the best one for a beginner.

~~~
commandar
Provided you have some familiarity with C like languages. I'm skimming through
this now, and it really is quite well-written, but I'd be totally lost if I
didn't have some experience with C/C++ in school years ago since it does make
a number of assumptions that you'll just 'get it' -- e.g., the section on for
loops pretty much says "they work like in C." :)

------
jckarter
An introduction really shouldn't encourage things like "for (var i = 0, item;
item = a[i]; i++)". Someone's going to cut-and-paste that because it looks
cute, and their code will break when their array suddenly needs to contain
null values. Fuzzy boolean semantics are bad enough without spreading stuff
like this around (speaking from experience with || abuse in Perl).

~~~
freakwit
To be fair, they do note this shortcoming.

"Note that this trick should only be used for arrays which you know do not
contain "falsy" values (arrays of objects or DOM nodes for example). If you
are iterating over numeric data that might include a 0 or string data that
might include the empty string you should use the i, j idiom instead."

~~~
WilliamLP
So it should be used approximately never in real code.

------
llaxsll
This article has a good description of closures, which is very important to
brush up on if one is developing a heavy dhtml site. Thanks.

~~~
AlexMuir
DHTML - That's a blast from the past. Don't see that acronym any more.

~~~
llaxsll
What would you call it, Mr. AlexMuir ? :)

~~~
AlexMuir
I'm not saying it's the wrong term, just that I've not seen it for ages. I
think people just sort of take it for granted nowadays that HTML probably
includes Javascript, rendering the D for dynamic a bit redundant.

------
jasonjohnson
Not a bad guide, old as it may be. Chuckled a bit when I read, "JavaScript has
a _tertiary operator_ for one-line conditional statements..." - been in there
since the original version.

<http://en.wikipedia.org/wiki/Ternary_operation>

~~~
WilliamLP
That could be worked into a great programming language misappropriation-based
comedy routine! Also the one about the guy who said "overriding" when he meant
"overloading" is usually good for a laugh.

------
limist
If you like this article, you'll _love_ the book "Javascript: The Good Parts":

[http://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockfor...](http://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockford/dp/0596517742)

------
michaeltwofish
This article provided my "aha!" moment for prototypes.

