JavaScript concept with a cup of coffee and a laptop

Conditional Statements

Just like in C#, JavaScript utilizes conditional, control-flow statements. One of the most common is the IF statement. IF statements evaluate Boolean statements…greater than, less than, etc. Equal/Not equal is another evaluation statement. In JavaScript, there are two ways to work with equal/not equal. You can utilize two or three equal signs. Two equal signs evaluates value only. Three equal signs evaluates value and type. For example…

The same principle applies to not equal…

Other than the aforementioned JavaScript specific aspects, the same control-flow statements exist in JavaScript as in C#…

  • if/else
  • switch
  • for loop
  • while loop

Happy Coding!

Clay Hess

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email
Skip to content