DEV Community

loading...

Discussion on: JavaScript Interview Question #17: Sum of Two Empty Arrays

Collapse
andreidascalu profile image
Andrei Dascalu

No, the question itself doesn't check the depth of knowledge unless you state it such that it requires the detailed explanation as part of the answer.

Otherwise, it goes like this: JavaScript is a loosely typed language that performs lots of magic type conversion. Something empty generally does equal false, so does the sum of two empty things? It's a safe bet to say yes.

Thread Thread
coderslang profile image
Coderslang: Become a Software Engineer Author

You're absolutely right. But the issue is that most wannabe Junior devs wouldn't understand what you just said. What I'm trying to do, is to get them thinking a bit deeper than the regular "crash course" curriculums.

And the question absolutely requires an explanation. Otherwise, everyone has at least a 50% chance of success here.