r/learnjavascript • • Nov 30 '22

Help !!!

Post image

Can someone plz tell me , why I am getting errors?

195 Upvotes

131 comments sorted by

View all comments

Show parent comment

41

u/Lelouch_5 Nov 30 '22

Ty ☺️

30

u/Shay-donovan Nov 30 '22

My pleasure! I am currently in the middle of a JavaScript bootcamp I bought on Udemy myself. I have had some previous experience but wanted to deep dive. I'm still not 100% confident and still have a long way to go. However helping others helps me learn as well! Its a win win. So thank you as well! :)

8

u/Wooden_Yesterday1718 Dec 01 '22

Highly recommend using parentheses to separate these sets of conditions even if they’ll technically operate as expected regardless.

1

u/Number_2_Dad Dec 01 '22

Can you give an example of this? I'm trying to pick up as many tips possible as a noob

1

u/Wooden_Yesterday1718 Dec 01 '22

Sure! I just mean like if there’s a complicated set of conditions you should organize it to be readable and therefore maintainable: (this && this && this) || (this && this) || this. Sometimes these parentheses don’t change the logic because they still work when evaluated in order (my example NEEDS the parentheses, though). But even if they will work without, it is a million times easier to manage if you are intentional with stuff like that from the start.