Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. jQuery and JavaScript: Luke jQuery, I... > Comparison and logical operators

Comparison and logical operators

For conditional logic statements (like if/else or do...while) to work properly, they have to be able to make the right decision based on what they are checking for. To do this, they use a series of comparison and logical operators to help them make the decision. In JavaScript, there are seven different comparison operators and three logical operators, as well as a shorthand operator for the if/else statement, called the ternary operator. We’ve seen some of these already, but here’s the full list.

image with no caption
image with no caption
Sharpen your pencil

Update your hand object to check if the value of the current_total property meets the criteria for the game (go back and check the original email if you don’t remember all the rules). Here’s the existing object, as well as pieces of the new code you need to write.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint