DEV Community

Discussion on: My family solves a code challenge 🎁

Collapse
 
cerchie profile image
Lucia Cerchie

Thanks Darryl! I didn't google anything, so I ended up with longer syntax for some of these -- your solution pares it down nicely! And the code block suggestion is great for blogging on DEV, thanks!
I believe 'middle' is the correct variable though-- and it's actually length that's wrong -- according to the equation we need the middle length for calculating the width tolerance and the longest length for the length tolerance -- so it should be if (longest <= 4) { ...etc.

Collapse
 
darrylnoakes profile image
Darryl Noakes

Ah, yes, I understand now.
Will update my comment. 👍