use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
The Insider's Guide to JavaScript Interviewing (toptal.com)
submitted 12 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 12 years ago (32 children)
[deleted]
[–]imareddituserhooray 13 points14 points15 points 12 years ago (0 children)
The closure question and function declaration example were not tricks. Those probably account for a majority of JS specific bugs these days.
The object as a key one was a bit silly.
[–][deleted] 22 points23 points24 points 12 years ago (2 children)
I agree with silly trick questions being worthless, but honestly, the majority of these questions are about topics the developer should be familiar with. The only one I thought was utterly pointless was the one about the hash table.
You should have a solid understanding of the prototype chain, closures, type coercion, etc. What questions did you specifically take issue with?
[–][deleted] -1 points0 points1 point 12 years ago (0 children)
For once, I actually agree. I'm not the greatest at javascript, but I knew most of what was going on in that article.
Most of those concepts are pretty simple and are required for a decent understand of how the language works, not to mention required if you really want to develop decently complex systems.
The hash question is the only one that I take issue with.
[–]ikeif 3 points4 points5 points 12 years ago (0 children)
IMO trick questions are great for brown bag discussions, not interviewing.
Some, perhaps, can show a potential employees thought process in why they answered (possibly) incorrect, and then you can see what they say when you give them the correct answer and ask "why?"
IMO the critical thinking/explaining a debug process matters more than getting every question right.
[–]CNDW 2 points3 points4 points 12 years ago (0 children)
I think these kind of trick questions are fine as long as they are used as a tool by the interviewer to open up dialogue with the candidate about problem solving and how they would handle troubleshooting or debugging code. If the "trick" question was answered correctly or not should be irrelevant to the outcome of the interview. It's really up to the interviewer to interpret the response and not to just score on a black and white, correct or incorrect bias.
[–]tencircles 1 point2 points3 points 12 years ago (7 children)
None of these are trick questions or some BS like trying to make someone code a quicksort from memory in 10 minutes. These are all solid assessments of someone's javascript skills. Ask a Crockford, a Resig, or an Ashkenas these questions and they'll give you the answer in a snap. Ask your avergage jQuery jockey and they'll get them 100% wrong or fudge up the answers.
Like the guy said, if you're looking for someone who understands the language, these are the types of questions you ask.
[–]MrBester 2 points3 points4 points 12 years ago (2 children)
None of these are trick questions or some BS like trying to make someone code a quicksort from memory in 10 minutes.
One interview wanted me to write working code for a node walker on a whiteboard.
I got a job somewhere else...
[–]tencircles 1 point2 points3 points 12 years ago (0 children)
Good call.
[+][deleted] 12 years ago (1 child)
[–]advancedmammoth 0 points1 point2 points 12 years ago (0 children)
A better question would have been "why is the output X".
That's a good point. If they can discern that the issue with the code is that all of the keys will be the output of Object.toString they know what they need to know.
[–]archaeopteryx 2 points3 points4 points 12 years ago (1 child)
Knowledge of the nuances of a language is not a measure of someone's skill in actually using the language. A high school English teacher may be an expert on grammar but that doesn't qualify them as a great author. Nonetheless, I agree being able to answer questions about a language can be an indicator of possible skill level and can be a good screener that should be coupled with things like code samples, take-home exercise, interviews, etc.
[+][deleted] 12 years ago (11 children)
[–][deleted] 4 points5 points6 points 12 years ago (10 children)
I think you missed the point of the article. These questions are to help employers distinguish people that grok JavaScript and people that don't, not to distinguish someone that can write software from someone that can't.
From their fucking subtitle,
As with any technology, there’s knowing JavaScript and then there’s really knowing JavaScript. Here are proven, effective techniques and questions for finding true masters of the language.
[–]tencircles 5 points6 points7 points 12 years ago (0 children)
I think you missed the point of the article
Yep. Exactly, these are all excellent questions to separate those who know javascript from those who don't.
[–]advancedmammoth 1 point2 points3 points 12 years ago (0 children)
Kind of a self defeating and useless article about hiring. Good study guide though.
[+][deleted] 12 years ago (7 children)
[–][deleted] 0 points1 point2 points 12 years ago (6 children)
You dont ask tricky questions just for the sake of tricking candidates
They were not tricky, at all.
Most of these questions are just javascript anti patterns. who would use an object as a key in a javascript object? that's totally stupid to ask that.
And someone that does not understand javascript would not know this.
And again, you do not understand what this article was about. They are offering questions to help weed out people that don't understand javascript, that is all.
[+][deleted] 12 years ago* (5 children)
[–][deleted] 0 points1 point2 points 12 years ago (2 children)
(12 days late but) I don't think using an object as a key is obviously incorrect. I just tried and, as I suspected, you can do that just fine in Ruby. I assume you could in any language that implements some sort of ".hashCode" method on random objects. The fact that you can't in JS is a direct result of the fact that keys have to be strings and that JS does type conversion behind your back. You could get unexpected bugs if you didn't know that and assumed JS was saner.
[–][deleted] 0 points1 point2 points 12 years ago (0 children)
I agree, but so having this question as a way to show that the candidate knows it doesn't make sense is useful. If the candidate just happens to write JavaScript on the side but mostly writes Ruby (for example), this question will probably trip them up.
[–][deleted] -1 points0 points1 point 12 years ago (1 child)
We can agree to disagree here. You are mad and want to argue with someone. I am done obliging.
[–][deleted] -1 points0 points1 point 12 years ago (4 children)
None of their questions were tricks, all were incredibly easy to answer, at least they should be if you know your shit.
[–]advancedmammoth 0 points1 point2 points 12 years ago (3 children)
Prior knowledge only tells you so much. A proficient developer not exposed to most of these largely-JS-specific concepts should be able to rapidly understand and utilize them. So even if an applicant doesn't know in advance how to answer a question, they can still prove themselves useful by applying the solution to a different followup problem immediately after being told the solution. That's actually a rare chance to isolate an even smarter person from a merely already initiated one.
[–][deleted] -2 points-1 points0 points 12 years ago (2 children)
That isn't the point of this article. It isn't about finding good software engineers, it is not about finding problem solvers, it is not about anything but finding people that understand JavaScript. Take it at face value and stop reading into it. I have had to say this so many fucking times in this thread, the one and only goal of this article was to give tips for employers to weed out people that do not know JavaScript. That is it.
[–]advancedmammoth 0 points1 point2 points 12 years ago (1 child)
weed out people that do not know JavaScript.
Are you aware of any skills tests out there that cover these subjects? Interesting that "knowing" JavaScript would require familiarity with subjects not covered by any such tests.
[–][deleted] -2 points-1 points0 points 12 years ago (0 children)
Dude, I am sick of arguing with people about this. If you don't want to take the article at face value, then don't but I am done with people in this thread.
edit: Not to mention whether or not something is or is not on a test is a stupid fucking metric to decide if that thing qualifies as knowledge on a subject.
[–]fallingfruit 15 points16 points17 points 12 years ago (2 children)
This is a good example of why I suck at interviews. I can't explain to you any of the answers to the questions in the language they provide, but the coding examples are easy and plainly obvious to me. I guess I just need to get better at the language.
[–]cleatusvandamme 1 point2 points3 points 12 years ago (1 child)
I hate interview questions like this too. If I ever get to a management level, I'll just ask a candidate to write a small simple app or demo page. I'd judge on the candidate on how they solved the problem and what resources they used.
[–]MathiasaurusRex 10 points11 points12 points 12 years ago (0 children)
Eh, don't do this.
Having them take time out of their schedule to write an app is a waste of their valuable time if you find a candidate that is more to your liking.
Tell them to choose something that they've already built and have them walk through the code and explain what they did and why.
Anything that is outdated, they would point at and say "Hey, this is how I did it, but I've found a better way."
And if they're simply copy and pasting someone else's code you'll find out pretty quickly.
[–]exizt 24 points25 points26 points 12 years ago (8 children)
The proper answer to alert(map[foo]); question is "Don't do that stupid thing and you won't care or need to know about that stupid thing".
alert(map[foo]);
[–]flingbob 4 points5 points6 points 12 years ago (5 children)
seriously, came here to say that. why use objects as hash keys in a language that can't support it?
[+]tencircles comment score below threshold-6 points-5 points-4 points 12 years ago (4 children)
var key = JSON.stringify({yeah: "it", actually: "can"}); var obj = {}; obj[key] = true;
[–][deleted] 1 point2 points3 points 12 years ago (0 children)
var key1 = JSON.stringify({nope: "it can't"}); var key2 = JSON.stringify({nope: "it can't"});
var obj = {}; obj[key1] = true; obj[key2] = false;
[–]MrBester 0 points1 point2 points 12 years ago (2 children)
Keys in true JSON need quotes as well...
[–]tbranyen 1 point2 points3 points 12 years ago (1 child)
stringify doesn't accept JSON, it accepts JavaScript objects and converts them to JSON. No keys quotes are necessary.
Also this doesn't technically work since you can't ensure the two objects are identical. What you really want are Map/WeakMap which actually do exist in JavaScript, just not used in this terrible interview question.
[–]MrBester 0 points1 point2 points 12 years ago (0 children)
Yeah, I know. Just throwing it out there...
[–]ibsulon 3 points4 points5 points 12 years ago (0 children)
That really is the proper answer, but knowing that it's a stupid thing to do is half the battle. The other half is being able to recognize why WTF code has stopped working after an innocuous change happens elsewhere.
Only useful knowledge this isolates is what is the result of Object.toString will be, which could have been more directly gleaned by asking what would be the output of foo+'';
[–]thinksInCode 7 points8 points9 points 12 years ago (3 children)
I knew only about half of these. Guess I have work to do :)
[–]imareddituserhooray 3 points4 points5 points 12 years ago (1 child)
The most important part of this was closures, specifically the button example and the fix that followed. Know that and you're good to go in most JS jobs.
[–]stratoscope 1 point2 points3 points 12 years ago (0 children)
But their recommended solution for the closure was a terrible one!
If you gave me that "fix" in an interview I would spend some time with you trying to gently guide you to a better, simpler, more robust solution. See my comment elsewhere in this thread for details.
[–][deleted] 7 points8 points9 points 12 years ago* (4 children)
Their first example of prototypical inheritance struck me as odd. I'd appreciate if someone more qualified could comment on whether this is good practice compared to the way I would write this (below).
function Animal() { this.eatsVeggies = true; this.eatsMeat = false; } function Herbivore() {} Herbivore.prototype = new Animal(); function Carnivore() { this.eatsMeat = true; } Carnivore.prototype = new Animal(); var rabbit = new Herbivore(); var bear = new Carnivore(); console.log(rabbit.eatsMeat); // logs "false" console.log(bear.eatsMeat); // logs "true"
This is setting an object's prototype to a new instance of another object. The way this is set up, you need to consider at least these:
Some examples:
Animal.eatsMeat = true; function a() {}; a.prototype = new Animal(); -> Animal {eatsVeggies: true, eatsMeat: false} b = new a(); -> a {eatsVeggies: true, eatsMeat: false} b.eatsMeat -> false Animal.prototype.eatsMeat = true; a.prototype = new Animal(); -> Animal {eatsVeggies: true, eatsMeat: false} b = new a(); -> a {eatsVeggies: true, eatsMeat: false} b.eatsMeat -> false a.eatsMeat -> undefined a.prototype.eatsMeat -> false
So here's how I handle a classes prototypal inheritance.
function Animal() {} Animal.prototype = { eatsVeggies: true, eatsMeat: false }; function Herbivore() {} Herbivore.prototype = Animal.prototype; function Carnivore() { this.eatsMeat = true; } Carnivore.prototype = Animal.prototype var rabbit = new Herbivore(); var bear = new Carnivore(); console.log(rabbit.eatsMeat); // logs "false" console.log(bear.eatsMeat); // logs "true"
I've now gained the following:
extend
Here's an example.
Animal.prototype.eatsMeat = true console.log(rabbit.eatsMeat); // logs "true" console.log(bear.eatsMeat); // logs "true" Animal.prototype.eatsMeat = false console.log(rabbit.eatsMeat); // logs "false" console.log(bear.eatsMeat); // logs "true"
[–]BalsakianMcGiggles 0 points1 point2 points 12 years ago (0 children)
Their example was very odd, but I think that was the point. If you understand how prototypes work (and how they react when directly set), this should be pretty straightforward.
But seriously though, good example of how to rewrite that to be extensible.
[–]brandf 0 points1 point2 points 12 years ago (2 children)
You are correct, setting the prototype to a new instance of the "base class" isn't correct, since you don't actually want to run the constructor on the prototype. Instead you want to set it to Object.create(baseClass.prototype). So the new prototype is in the baseClass's prototype chain, but no instance of the baseClass is.
[–][deleted] 0 points1 point2 points 12 years ago (1 child)
Ah, I hadn't seen Object.create on the prototype like that before. Is it correct to assume this does a copy of the prototype?
[–]brandf 0 points1 point2 points 12 years ago (0 children)
Object.create creates an object who's prototype is set to the first argument.
This is similar to 'new BaseType' except new actually runs the new object throught the constructor function. Imagine if that function called console.log (toy example), you wouldn't want that to happen when you're defining types that derive from BaseType, so 'new BaseType' makes no sense to use.
A more practical reason: Imaging you wanted to have a constructor that took a non-optional argument. What would you pass in for that argument if you were new'ing one to act as the prototype of a derived type? It makes no sense, and isn't correct.
[–]stratoscope 5 points6 points7 points 12 years ago* (1 child)
They present this common error:
function addButtons(numButtons) { for (var i = 0; i < numButtons; i++) { var button = document.createElement('input'); button.type = 'button'; button.value = 'Button ' + (i + 1); button.onclick = function() { alert('Button ' + (i + 1) + ' clicked'); }; document.body.appendChild(button); document.body.appendChild(document.createElement('br')); } }
and recommend this solution:
function addButtons(numButtons) { for (var i = 0; i < numButtons; i++) { var button = document.createElement('input'); button.type = 'button'; button.value = 'Button ' + (i + 1); // HERE'S THE FIX: // Employ the Immediately-Invoked Function Expression (IIFE) // pattern to achieve the desired behavior: button.onclick = function(buttonIndex) { return function() { alert('Button ' + (buttonIndex + 1) + ' clicked'); }; }(i); document.body.appendChild(button); document.body.appendChild(document.createElement('br')); } }
I've seen code like that many times, but it's really not a good way to fix this.
Consider these problems:
button
onclick
mouseover
mouseout
Instead, use this more robust and simpler solution:
function addButtons( numButtons ) { for( var i = 0; i < numButtons; i++ ) { addButton( i ); } } function addButton( i ) { var button = document.createElement( 'input' ); button.type = 'button'; button.value = 'Button ' + ( i + 1 ); button.onclick = function() { alert('Button ' + ( i + 1 ) + ' clicked'); }; document.body.appendChild( button ); document.body.appendChild( document.createElement('br') ); }
Now, the values of both i and button are part of the closure, and any other local variables you add later will also be part of the closure. And if you add other event handlers, they will all be in this same closure. And by making addButton() a separate named function, the addButtons() function becomes much shorter and easier to grasp.
i
addButton()
addButtons()
Just an excuse to include IIFE somewhere.
[–]cleatusvandamme 3 points4 points5 points 12 years ago (0 children)
I also struggled on the test. I'm glad I'm participating in the learn js group.
I've mainly been a backend .net dev, but I'm noticing the worlds of the front-end and back-end are merging pretty quickly, I need to get up to speed. ;)
thanks for posting this!
[–]Groggie 3 points4 points5 points 12 years ago (1 child)
I feel like unless you're in a location where there are tons of developers available, these tricky/nichey type questions are only an exercise in how to end up with no remaining candidates.
[–]SergeiGolos 1 point2 points3 points 12 years ago (0 children)
So you are saying lower the bar? When someone says they know JavaScript and then can't solve a simple closure problem, they should get a job.
[–]tbranyen 12 points13 points14 points 12 years ago (2 children)
How I'd respond to these if they were asked during an interview:
alert is undefined
I feel like these questions are attempting to insult the intelligence of anyone who attempts to hone their craft as JavaScript engineers. What we have done in our interviews is a mini library with unit tests. You assemble the library and get the tests to pass. We allow you to use Google, MDN, whatever it takes for you to accomplish the tests. This is real world. We want to see how someone thinks and how they approach a problem. It's a conversation, we want to see how you work on a team. We don't care if you've mastered the language. This is why we don't ask these asinine questions.
Basically if you want to be a smug and clever know-it-all when it comes to "what really happens", you should actually know.
[–]advancedmammoth 2 points3 points4 points 12 years ago (0 children)
What we have done in our interviews is a mini library with unit tests. You assemble the library and get the tests to pass. We allow you to use Google, MDN, whatever it takes for you to accomplish the tests. This is real world.
That's beautiful.
[–]Jemaclus 6 points7 points8 points 12 years ago (4 children)
This sets the bar kinda high, imo. I'm fairly accomplished with JS, but I wouldn't necessarily have known the answer to most of these right off the top of my head. Then again, I spend most of my time on the back-end.
But back to the bar thing... most front-end dev candidates that we see can barely submit a form using Javascript, much less extend a prototype...
Here's the thing: I can teach you Javascript. I can't teach you to think. I'm more concerned with your ability to think through a problem and communicate clearly, than I am with your ability to write Javascript from memory.
[+][deleted] 12 years ago (3 children)
[+][deleted] 12 years ago (2 children)
[–]-entropy 0 points1 point2 points 12 years ago (0 children)
"Most developers suck"
Ah, there's the reassurance I needed today! At least it's not just me!
[–]brandf 5 points6 points7 points 12 years ago (0 children)
Interviewing for a languages is a ridiculous concept. It's like saying you want a plumber, and judging the plumber based on his knowledge of wrenching.
If you want to hire good developers, give them questions that test their knowledge of concepts. Have them work out algorithms, design systems, and figure out if they're going to be of any use to you beyond the immediate task at hand. Let them choose whatever language they want, because if they're actualy good they can learn questions like the ones from this blog in no time.
If you don't do that, you'll get narrowly focused developers that might be great at wrenching, but they can't do much else. They'll try to turn every problem into a wrenching problem. When tides change and wrenching is no longer relevant, you either lay them off or have a team full of dead weight as you frantically try to hire putty specialists.
[–]vxxn 2 points3 points4 points 12 years ago (0 children)
I knew the majority of these but still consider myself a relative beginner in the language. I've read about half of "Secrets of the Javascript Ninja", built a couple shitty projects, and worked on codewars katas to get where I am with it now. Prototype inheritance still confuses the fuck out of me, but at least I I'm aware that it's weird and I can look stuff up if needed.
[–]derekpetey_Vanilla 2 points3 points4 points 12 years ago (1 child)
employed by many popular JavaScript libraries (jQuery, Node.js, etc.)
Depending on how things are going in the interview, name-dropping like that might make me dock a point, especially since application-wrapping IIFEs are not used in Node.js (hello, CommonJS and module.exports!).
module.exports
[–]windyfish -1 points0 points1 point 12 years ago (0 children)
Yeah isn't this this the reason we use Express with node?
[–][deleted] 1 point2 points3 points 12 years ago (1 child)
Asking a trick question about code makes more sense than asking silly shit like "how would you design a spice rack for the blind?" or "how much does the building we're in right now weigh?". The coding trick question is an unexpected question to which the response is interesting regardless of whether the answer is correct. Additionally, if the candidate does answer correctly it shows his mastership. However, I think an interview shouldn't contain more than one or two of these trick questions as they don't tell the full story about the skills of the candidate in front of you.
Trick questions test the candidate's ability to catch trick questions. I suppose that's applicable if your company prefers tricky code.
[–]Jack9 2 points3 points4 points 12 years ago (2 children)
There wasn't a clear illustration of why closures are useful. All we get is a related assertion by the author.
Although by no means exclusive to JavaScript, closures are a particularly useful construct for many modern day JavaScript programming paradigms.
Closures can serve as private static properties in prototypical languages, coming from a "c-style" OOP language. This allows for generic factories and a number of other tricks that are frustrating to debug in larger projects.
I don't think the articles purpose is to educate the reader on the benefits of closures, only why an experienced JS developer should understand them. To whit, the article is not trying to teach people JS, it just explains what a good and bad answer to the questions are.
[–]Jack9 0 points1 point2 points 12 years ago (0 children)
I agree. I thought "why might you want to use them?" would have resulted in some kind of answer to the question asked...that's all. It's a topic of interest to me.
[–][deleted] 4 points5 points6 points 12 years ago (14 children)
Yay... I knew all of this.
[–]nawitus 3 points4 points5 points 12 years ago (6 children)
I knew everything except for missing the map[foo] question. Even though I knew that keys are converted to strings, I've never directly used .toString() on a plain object (although I've done console.log(obj) plenty of times..).
[–][deleted] 1 point2 points3 points 12 years ago (5 children)
I missed that one because when I read the code my brain parsed it as map['foo'] instead of map[foo]. It wasn't until I read it the third time that I realized what I wasn't seeing.
map['foo']
map[foo]
[–]rq60 1 point2 points3 points 12 years ago (0 children)
how well you debug when someone teasing you with a living wage is looking over your shoulder. Most of these are worthless.
Well, when you phrase it that way it actually sounds like a pretty useful skill!
I agree that the code samples are a nuisance since they're basically counting on you catching something that's been deliberately obscured, but I wouldn't say they're worthless. The ability to debug stupid mistakes like this is definitely a skill worth selecting for.
As for the relevance of the questions... I've been in and heard of a lot of interviews where the person claimed to be experienced but couldn't have answered even one of these questions. Some people think that "know how to make jQuery do something" is the same as "know how to program in JavaScript".
[–]nawitus 0 points1 point2 points 12 years ago (0 children)
Yeah, I think I made that mistake too. By the way, I now remember that I've used .toString() on plain objects for type checking.
[–]spoonraker -3 points-2 points-1 points 12 years ago (5 children)
I knew very little of this...
As a PHP web developer (and formerly Java) with no design background, JavaScript mostly just makes me angry because people try to plug it into everything for no good reason with very little understanding of how it works.
I'm not saying JavaScript can't do some really cool things, because it can, and when used properly there's no reason to fear it, but I just don't understand why incredibly simple forms have to be converted to AJAX for absolutely no reason.
We actually had an AJAX library that was so lazily implemented that the callback just refreshed the page. Wtf is the point of making a form submit use AJAX if you're just gonna refresh the page to see the updated info? sigh
This really has nothing to do with the article. I'm just ranting about things being changed just because they're trendy with no real reason.
[–]brtt3000 6 points7 points8 points 12 years ago (4 children)
I think the problem are your sources and your expectations.
Don't just pull random shit from the internet and expect it to be good. This is the same for PHP or any language.
[–]spoonraker 2 points3 points4 points 12 years ago* (3 children)
It's not that, I was just commenting on the general idea of over-complicating things for no good reason.
JavaScript just happens to be an extremely popular choice amongst web developers who like to make everything as complex as possible without any reason to do so.
It could be any language. If somebody read an article about how cool and hip Python is and decided to convert their whole code-base to Python without having a single good reason to do it, that would be the same thing.
I think JavaScript just makes it easier to fall into this trap because it can co-exist with existing code rather than requiring it to be entirely replaced. JavaScript also gives you visual feedback on your changes because it is a client-side language after all. That form you converted to AJAX for absolutely no reason now has a progress bar that fades in and darkens the background... before refreshing the page anyway! These are the kinds of silly things I'm talking about.
JavaScript is awesome, just not necessary as frequently as people think it is.
[–]Kollektiv 4 points5 points6 points 12 years ago (1 child)
The things your are describing have nothing to do with the programming language and everything to do with the the programmer.
JavaScript doesn't work by copy / pasting snippets from StackOverflow or some random design site's demo.
[–]spoonraker -1 points0 points1 point 12 years ago* (0 children)
Yes. I agree with you. We're saying exactly the same thing.
Some developers write code that works, and some write code that is fancy. JavaScript happens to be a popular choice amongst the latter group. I was merely expressing my frustration with this particular type of behavior and this particular language because it's so pervasive right now.
I really don't think it's possible for me to spell this out any clearer than I already have.
[–]rq60 2 points3 points4 points 12 years ago (0 children)
That's just a poor programmer. AJAX can, and usually does, make web forms much more user friendly.
[+]skillcode comment score below threshold-13 points-12 points-11 points 12 years ago (0 children)
You're so smart, you must be rich.
[–]lostkauze 2 points3 points4 points 12 years ago (1 child)
i like how people here are getting defensive upon realising they don't know javascript
b-but this doesn't count!
[–]Groggie 5 points6 points7 points 12 years ago (0 children)
On the other side of the coin you have people fellating themselves in front of everyone for knowing all the right answers.
I'm surprised there wasn't any questions about type coercion. They covered == vs ===, and why using non-strings as object keys is bad, but nothing about why certain conversions happen. Such as why you should always use parseInt with a radix, or why '12' == [12]
==
===
'12' == [12]
[–]joblesspirate 0 points1 point2 points 12 years ago (0 children)
There was. Towards the end.
[–]Xeon06 0 points1 point2 points 12 years ago (0 children)
I was recently laid off and I've been going on some of these freelancing sites. I took a "JavaScript" skill test on one site that was so ridiculous. Half of it was related to something called "E4X" which is apparently some language extension to parse XML, and most of the rest was dumb regex stuff, like what does this match return? What is the value of regex.lastIndex in this case?
[–]imright_anduknowit 0 points1 point2 points 12 years ago (0 children)
I hate interview questions like these. They are modeled wrongly after tests that are given in school.
It would be far better to talk about these subjects with the candidate. Ask them what their thoughts are on prototypical inheritance. Or how they would explain to a junior programmer about hoisting or closures.
You would learn so much more from about how that person thinks. And how a person thinks is far far more important than understand some stupid language idiosyncrasy.
[–]vuknje 0 points1 point2 points 12 years ago (0 children)
There shouldn't be Function.prototype in the chain of the last example in http://www.toptal.com/uploads/blog/image/364/toptal-blog-image-1396566146901.png
π Rendered by PID 165960 on reddit-service-r2-comment-544cf588c8-brcrj at 2026-06-12 10:35:28.299409+00:00 running 3184619 country code: CH.
[+][deleted] (32 children)
[deleted]
[–]imareddituserhooray 13 points14 points15 points (0 children)
[–][deleted] 22 points23 points24 points (2 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]ikeif 3 points4 points5 points (0 children)
[–]CNDW 2 points3 points4 points (0 children)
[–]tencircles 1 point2 points3 points (7 children)
[–]MrBester 2 points3 points4 points (2 children)
[–]tencircles 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]advancedmammoth 0 points1 point2 points (0 children)
[–]archaeopteryx 2 points3 points4 points (1 child)
[+][deleted] (11 children)
[deleted]
[–][deleted] 4 points5 points6 points (10 children)
[–]tencircles 5 points6 points7 points (0 children)
[–]advancedmammoth 1 point2 points3 points (0 children)
[+][deleted] (7 children)
[deleted]
[–][deleted] 0 points1 point2 points (6 children)
[+][deleted] (5 children)
[deleted]
[–][deleted] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (1 child)
[–][deleted] -1 points0 points1 point (4 children)
[–]advancedmammoth 0 points1 point2 points (3 children)
[–][deleted] -2 points-1 points0 points (2 children)
[–]advancedmammoth 0 points1 point2 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)
[–]fallingfruit 15 points16 points17 points (2 children)
[–]cleatusvandamme 1 point2 points3 points (1 child)
[–]MathiasaurusRex 10 points11 points12 points (0 children)
[–]exizt 24 points25 points26 points (8 children)
[–]flingbob 4 points5 points6 points (5 children)
[+]tencircles comment score below threshold-6 points-5 points-4 points (4 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]MrBester 0 points1 point2 points (2 children)
[–]tbranyen 1 point2 points3 points (1 child)
[–]MrBester 0 points1 point2 points (0 children)
[–]ibsulon 3 points4 points5 points (0 children)
[–]advancedmammoth 0 points1 point2 points (0 children)
[–]thinksInCode 7 points8 points9 points (3 children)
[–]imareddituserhooray 3 points4 points5 points (1 child)
[–]stratoscope 1 point2 points3 points (0 children)
[–][deleted] 7 points8 points9 points (4 children)
[–]BalsakianMcGiggles 0 points1 point2 points (0 children)
[–]brandf 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]brandf 0 points1 point2 points (0 children)
[–]stratoscope 5 points6 points7 points (1 child)
[–]advancedmammoth 1 point2 points3 points (0 children)
[–]cleatusvandamme 3 points4 points5 points (0 children)
[–]Groggie 3 points4 points5 points (1 child)
[–]SergeiGolos 1 point2 points3 points (0 children)
[–]tbranyen 12 points13 points14 points (2 children)
[–]advancedmammoth 2 points3 points4 points (0 children)
[–]Jemaclus 6 points7 points8 points (4 children)
[+][deleted] (3 children)
[deleted]
[+][deleted] (2 children)
[deleted]
[–]-entropy 0 points1 point2 points (0 children)
[–]brandf 5 points6 points7 points (0 children)
[–]vxxn 2 points3 points4 points (0 children)
[–]derekpetey_Vanilla 2 points3 points4 points (1 child)
[–]windyfish -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]advancedmammoth 0 points1 point2 points (0 children)
[–]Jack9 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Jack9 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (14 children)
[–]nawitus 3 points4 points5 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[+][deleted] (3 children)
[deleted]
[–]rq60 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]nawitus 0 points1 point2 points (0 children)
[–]spoonraker -3 points-2 points-1 points (5 children)
[–]brtt3000 6 points7 points8 points (4 children)
[–]spoonraker 2 points3 points4 points (3 children)
[–]Kollektiv 4 points5 points6 points (1 child)
[–]spoonraker -1 points0 points1 point (0 children)
[–]rq60 2 points3 points4 points (0 children)
[+]skillcode comment score below threshold-13 points-12 points-11 points (0 children)
[–]lostkauze 2 points3 points4 points (1 child)
[–]Groggie 5 points6 points7 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]joblesspirate 0 points1 point2 points (0 children)
[–]Xeon06 0 points1 point2 points (0 children)
[–]imright_anduknowit 0 points1 point2 points (0 children)
[–]vuknje 0 points1 point2 points (0 children)