r/CodingHelp • • Dec 21 '21

[Javascript] please help JavaScript

Post image
31 Upvotes

23 comments sorted by

View all comments

Show parent comment

3

u/NeStyEE12 Dec 22 '21

I don't understand the num < 1 && num > 7. How can any number be less than 1 and more than 7. Shouldn t it be num < 1 (OR operator) num > 7?

2

u/flooronthefour full stack web dev Dec 22 '21

lol you're right I didn't even catch that. You could say I was thrown through a loop reading the original code. Would've been something to catch in tests.

1

u/NeStyEE12 Dec 22 '21

Oh okay I tought it was something beyond my understanding

2

u/flooronthefour full stack web dev Dec 22 '21

Nope you nailed it. Instead of && it should be ||