DEV Community

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

mishmanners profile image
Michelle Mannering Author

I had about 30 developers looking at it live. You can see it in the video link (a link to the full live stream), and you can see a link to my GitHub repo (linked in the article).

Thread Thread
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 Author

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 Author

Thanks for this. Will check it out