News for hackers. Stuff that matters.
Re:Do you really know JavaScript? by clavalle on Friday January 31, 2014 @05:30PM (#7159615)
I wish there was a 'JavaScript Under the Microscope' like 'Ruby Under the Microscope' by Pat Shaughnessy.

I think I would have a much better understanding of JavaScript if I knew how a good javascript engine works.

Re:Do you really know JavaScript? by gcommer on Friday January 31, 2014 @06:02PM (#7159756)
The author of this quiz could have made this a great learning opportunity by linking to the appropriate sections in ECMA-262[0].

For example, question 15 makes a lot more sense when you read "ToBoolean" (Sec 9.2) which shows that all objects (including arrays) are always considered truthy values, however when compared with ==, "The Abstract Equality Comparison Algorithm" (11.9.3) is used, which gives this behavior:

  >> [0] == [0]
  false
  >> a = [0]; a == a
  true
because a shallow comparison is used.

[0] http://www.ecma-international.org/publications/files/ECMA-ST...

Re:Do you really know JavaScript? by anaphor on Friday January 31, 2014 @07:36PM (#7160252)
So it's like Scheme's "eq?", except less useful?
Re:Do you really know JavaScript? by noir_lord on Friday January 31, 2014 @05:51PM (#7159704)
> I think I would have a much better understanding of JavaScript if I knew how a good javascript engine works.

So would the people who write the good javascript engines.

I'm joking but only partially as they have to write an engine against both a standard and a convention plus support all the hacks going back years.

It's a mess but what I'm slowly and painfully learning is that if you avoid the shoals and hidden wrecks you can do some cool stuff with JS.

Re:Do you really know JavaScript? by erichurkman on Friday January 31, 2014 @07:13PM (#7160155)
One easy step in the right direction is a quality build process that includes linting and strong error/warning reporting. Push your code through the Closure compiler and keep JSHint (or your favorite linter) active in your editor and you're already taking a strong step to better JavaScript.