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.
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.
Ah, yes, I understand now.
Will update my comment. 👍