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 trial

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Review Boolean Logic

Bug in quiz

The quiz told me i'm wrong. and that the answer would be B but if im correct the answer would be A..

var ships = 10; var score = 0; if ( ships === 0 || score === 0 ) { console.log('Game over.'); } else { console.log('Your score is zero.'); }

A : Game Over B : Nothing will appear C : Your score is zero

1 Answer

JEFF CHAI
JEFF CHAI
7,564 Points

We change the question into statement if( (ships equal to 0) or (score equal to 0) ) then console.log('Game over.'); else console.log('Your score is zero.');

The '||' mark in java stand for 'or' therefore the answer is 'A' Game over

yeah as i did