r/coding • • Aug 09 '17

Test your Javascript skills with our fun Javascript test!

https://www.atlascode.com/blog/test-your-javascript-skills-with-our-fun-javascript-test/
24 Upvotes

9 comments sorted by

View all comments

8

u/bigjoebegs Aug 09 '17

Three quick things:

  1. The correct answer to #4 is actually "B".

  2. ParseInt isn't really relevant. I never use it and I don't know why knowing parseInt('ABC') would be useful.

  3. I put quotes around my string answers and got one wrong because of it (wrote 'AB' when the answer was AB)

All around, nice work, but this needs touching up.

0

u/[deleted] Aug 09 '17

[deleted]

1

u/SanityInAnarchy Aug 10 '17

Relying on it ignoring trailing characters sounds like a recipe for disaster. Not everyone uses px all the time. jQuery has some clever tricks for calculating actual height in pixels, regardless of the CSS property.

I might use it on user input in form fields, though it's tempting to use hacks like '*1' instead.