DEV Community

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

Collapse
 
vlasales profile image
Vlastimil Pospichal

Your code is wrong. You deserve it.

Collapse
 
mishmanners profile image
Michelle Mannering

Hahahah, totally! I was just so confused that no one else could figure it out either. But hey, it's all a learning curve right? I am loving it though!!!

Collapse
 
vlasales profile image
Vlastimil Pospichal

If you show your code, I'll show you how to improve it.

Thread Thread
 
mishmanners profile image
Michelle Mannering

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

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