Ad
  • Default User Avatar

    Apart from the last bit, when you could return directly (isCorrectLength && hasOnlyNumbers), i found that this is the clearest solution. Easy to read, not over-engineered. I think that this community is a bit obsessed about writing super-concise one-liner code: this works and it's super-readable, some developers prefer to write some additional lines of code instead of sacrificing clarity and readability... what's the problem?

  • Default User Avatar

    I agree with chandlerroth, this is a brilliant and concise solution but readability / reusability is terrible.