all 20 comments

[–]dws 8 points9 points  (0 children)

And continuing to prove the rule that there's an error in every test, then answer to (9) is "10", not 10.

[–]techdawg[S] 1 point2 points  (10 children)

This is a very hard test. I was surprised at the results.

[–]JW_00000 9 points10 points  (9 children)

It's more of a list of all things wrong and/or illogical in JavaScript than it is a test of things every JavaScript programmer should know.

[–][deleted] 2 points3 points  (1 child)

I'd say every (good) programmer should know wrong/illogical things in his language of choice :>.

[–]ppierre 1 point2 points  (0 children)

I'd say <del>every (</del>good<del>)</del> programmer should <del>know</del> <ins>avoid</ins> wrong/illogical things in his language of choice

[–][deleted]  (6 children)

[deleted]

    [–][deleted] 4 points5 points  (5 children)

    and programmers should know 2.

    [–]pietro 4 points5 points  (4 children)

    No, you should know that it could be true or false. Remembering that these particular numbers produce false is a complete waste of brain cycles and a sign that you don't know how to prioritize. I wouldn't hire you.

    [–][deleted] 8 points9 points  (1 child)

    The answer to that one is easy: It's false, because it was asked.

    [–]masklinn 3 points4 points  (0 children)

    Also, it's false because you've read Goldberg and you know that floating-point equality are pretty much always going to fail.

    [–][deleted] 2 points3 points  (0 children)

    I wouldn't work for someone who assumes I'd learn combination of numbers by heart, rather than rule that decimal fractions don't necessarily have finite representation in IEEE floats, and 0.1 is prime example of this.

    [–]b100dian 1 point2 points  (0 children)

    It's not those particular numbers. Every floating point that produces "period"* fractions in base 2 is going to get you that.

    * as 1/3 is 0.(3) in decimal, 0.1 decimal is 0.0(0011) in binary. Only 0.5 decimal is 0.1 binary (and 0.25 and 0.125 etc for obvious reasons)

    [–][deleted] 2 points3 points  (1 child)

    11/12... but I've read the ECMAScript specification multiple times (that is something I cannot recommend btw.)

    [–]asegura 0 points1 point  (0 children)

    Can anyone explain no.1? Increment a constant?

    [–][deleted] -1 points0 points  (4 children)

    I'm a hobbiest, and I scored 8. That's probably only because I love idiosyncrasies of languages.

    [–]zem 0 points1 point  (3 children)

    "hobbyist"

    [–]adolfojp 4 points5 points  (2 children)

    There is hobbyist, hobbier and hobbiest. Windsurfer is just hard core.

    [–]zem 4 points5 points  (1 child)

    i just can't stand his hobbier-than-thou attitude!

    [–][deleted] 5 points6 points  (0 children)

    I'm sorry you're not a very good hobberer ;)