Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialyahya alhalki
1,149 Pointsmy question is why should we put || and not && between the current grade
my question is why should we put || and not && between the current grade i thought that if its || it means its okay if either of the conditions is true execute
that means if the current grade is 0 it will echo cause 0 is smaller than 12
elseif($currentGrade >= 9 || $currentGrade <= 12){ echo 'this is only for highschool student'; }
3 Answers
Jeff Gipson
4,847 PointsBecause both conditions donβt need to be true just one or the other.
yahya alhalki
1,149 Pointsyeah but wouldn't that mean if we just entered 0 it would be true cause 0 is smaller than 12.
yahya alhalki
1,149 Pointsoh oKKK i totally got it what she was trying to do
thank you for your time jeff