Operators – JavaScript

Operators – JavaScript

Table of Contents

And

fail

Code

<script type="text/javascript">
var a=30;
var b=50;
var c=60;
if(a>=40 && b>=40 && c>=40){
    document.write("pass");

}
else{
document.write("fail");
}
</script>

Mod

odd

Code

<script type="text/javascript">
var a=11;
var c=a%2;
if(c==0){
document.write("even");}
else{document.write("odd");}
</script>

Not

try again

Code

<script type="text/javascript">
var serveruser1="sanjay@gmail.com";

var username="sanjay@mail.com";
if(!(username==serveruser1)){
    document.write("try again");

}
else{
document.write("welcome user");
}
</script>

Not Equal

invalid

Code

<script type="text/javascript">
var serpass="gopal ";
var urpass="gopal";

if(serpass!=urpass){
document.write("invalid");
}
else{
document.write("correct");
}

</script>

OR

welcome user

Code

<script type="text/javascript">
var serveruser1="sanjay@gmail.com";
var serveruser2=9212001563;
var username="sanjay@gmail.com";
if(username==serveruser1 || username==serveruser2){
    document.write("welcome user");

}
else{
document.write("try again");
}

Take Your Free Live Demo Class Now

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Send You the Course Fees Details In Below Number

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

Enter Your DETAILS BELOW TO take

free demo class