DEV Community

Discussion on: The bane of every developer; spelling, casing, and random commas

 
vlasales profile image
Vlastimil Pospichal • Edited

Sorry, unfortunately I don't see a link to your GitHub.
You used the method toLowerCase() six times, you need it two times only. It doesn't occur to the developer that there can be a typo in one of the six calls, everyone would see it in the two calls.

Thread Thread
 
mishmanners profile image
Michelle Mannering

Linking here again: github.com/MishManners/Twilio-Ques...
We just did what the course told us to do. And yes, there were 30 different people arguing over how to best do it. This is what I love about live coding!

Thread Thread
 
vlasales profile image
Vlastimil Pospichal
const firstValue = process.argv[2].toLowerCase();
const secondValue = process.argv[3].toLowerCase();
if (firstValue < secondValue) {
    console.log(-1);
} else if (firstValue > secondValue) {
    console.log(1);
} else {
    console.log(0);
}
Thread Thread
 
mishmanners profile image
Michelle Mannering

Thanks for this. Will check it out