Whats wrong with my If OR function?

I can't seem to figure out why this wont work.

if (course_select == "ACC 225" || "acc 225" || "acc 225"|| "Acc 225"|| "225")

course_select is a string by the way, and I can't get this to work for me at all, I've tried playing with it, buy still no luck :-(
You actually have to put the course_select in each time you do an or; it's not implicit.

1
2
3
4
if (course_select == "ACC 225" ||
    course_select == "acc 225" ||
    ....
)


What it's doing currently is looking to see if the statement is 0. course_select == "ACC 225" returns a boolean, but when you get to "acc 225", it is a string, whose first value is the ASCII letter 'a' which is NOT 0. Therefore, that evaluates to true or (rather) non-0.
You were right it worked, Thanks ^_^
Topic archived. No new replies allowed.