Hi guys can anyone help me i need to learn how to use OR and AND in loop conditions using javascript

Recommended Answers

This sounds like you are looking for tutorials. Here's how I would find these today:

Jump to Post

All 2 Replies

Just like every other programming languages, javascript has OR and AND functionality.
&& means AND in javascript while|| means OR in javascript.



    function showAlert()
   var flag=0;
   if(flag != "" && flag == 0)
   alert ("The flag is zero");
   else if(flag != "" && flag == 0 || flag == 1)
    alert ("The flag is either 0 or 1");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.