SQL PHP HTML ASP JavaScript articles and free scripts to download
JavaScript Basics

AND OR NOT the logical operators

Logical operators are mostly consist of AND OR NOT and its combinations. We will discuss more on this with examples for better understanding.

We will use if condition to check and then document.write to print the result. Here is the code.

AND is also written as &&
OR is written as ||
NOT is written as !

var my_var=5;
var my_var2="plus2net";

Here is a table with different examples of logical operators
my_var=="5" && my_var2=="plus2net"True
my_var==="5" && my_var2=="plus2net"False
my_var==5 || my_var2=="plus2net"True
my_var==4 || my_var2=="plus2net"True

Be the first to post comment on this article :


Post Comment This is for short comments only. Use the forum for more discussions.
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2015 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer