Is the sum of two arrays equal to false?
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
To analyze this code snippet we need to understand how...
For further actions, you may consider blocking this person and/or reporting abuse
I do not want to work at a place that asks me something that wonβt be needed on the job and can easily be googled
The question is not how easy it is to google something. The point is to check the depth of your knowledge.
With this specific question, the interviewer will determine your skills in:
I appreciate the interesting tidbit of information but itβs not useful to determine the effectiveness of the dev.
I am much more interested in their understanding of OO and functional programming concepts, ability to test drive JS, yarn/npm, frameworks...
Dev trying to debug an error for couple of hours just because he doesn't understand how concatenation works, is basically waste of company's money and time. A small mistake can lead to unexpected consequences and delay in achieving deadline. Multiply number of such mistakes with the number of devs who do not know such details, the penalty is a huge. And this penalty is actually paid by entire company, every developer in the company because no one will have time to calculate such small mistakes.
You may put importance on what can be learned, i would be put importance on what someone understands. Anything can be learned and questions like these do not test if someone has the capacity to learn, but rather what he can memorize or has had experience with.
I believe if one has not learnt the basics in college/graduation, educating an employee isn't responsibility of an employer unless employee is ready to compensate the pay for learning. This has nothing to do with memorizing, memorizing is knowing each properties of elements of periodic table.
Fun fact: any combo of any number of
[],0,"", whitespace (mix-and-match is ok:" \n\n\n\r \t"),".","0"(repeated if you like:"000"),null,falseadded together will loose equalfalse, so long as:falseornull,On a related note, static typing is great π and there are plenty of tools/libs/langs available to code JS without this JS-framer weirdness.
Awesome comment! Thanks for the additional info.
I think JS is like poker to some extent. It takes a minute to learn and a lifetime to master π
Ohhhh this is a straight up bad example. I would not ask a junior this.
Yes, tests knowledge, but this is not an example you're ever likely to see in a real application. Anyone using this code who's not a grad or an intern is going to get a talking to and some help.
Loose equality is just equality, you're thinking strict & non strict equality.
This sort of stuff is code from 10+ years ago.
Thank you for putting this together. I appreciate the additional knowledge behind why things are the way they are in JS.
This is the basic idea behind single character line width js code : print "Hello World!"