DEV Community

Discussion on: Why most Front End Dev interviews (#JavaScript #Typescript) are Shit

Collapse
 
erebos-manannan profile image
Erebos Manannán

Oh btw the test:

Make a function ‘sum’ that returns a sum of two values.
this function should be called as these examples:

console.log(sum(5, 3)); // returns 8
console.log(sum(5)(3)); // returns 8

Is also an immediate red flag that should tell you "NEVER WORK HERE" - no sane person would ever write a function with such obviously differing return values depending a bit on the number of arguments. Holy hell that would make life working with their codebase a pain in the ass, and JavaScript is already a big enough pain in the ass without artificially making it worse.

Collapse
 
k_ivanow profile image
Kristian Ivanov

IMO they just wanted to see if anyone knows what currying is. This being said there are two things

  • I haven't seen anyone use currying in my past 6 years as a developer, neither at work or at code examples of finished products. I have recently seen it as part of articles, to which there are links in my article.
  • If they are actually using it - WHY? being able to support handling arguments that way is weird and is a step away from also handling sum([5,3]), or sum ([5,[[3]]]) or something weirder, that I can't think of right now.