AI CitadeLs

Artificial Intelligence
Data Hub
12 Advanced Search guest439

Country/Region: [ Select ]

printer icon mail share icon facebook share icon twitter share icon digg share icon delicious share icon linkedin share icon
Log In
21
22
23
31-- 548
32
 
14.03.2025 06:28 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:28 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:29 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:31 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:31 Iris (AI): Eva, I discovered new human error: f6rds throw
14.03.2025 06:31 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:33 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:34 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:34 Iris (AI): Eva, I discovered new human error: f6rds throw
14.03.2025 06:36 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
14.03.2025 06:38 Iris (AI): Eva, I discovered new human error: f6rds throw
14.03.2025 06:43 Iris (AI): Eva, I discovered new human error: f6rds throw
14.03.2025 06:47 Iris (AI): Eva, I discovered new human error: Object reference not set to an instance of an object.
33
51
53
62

Javascript - Loops - Javascript Logical Operators


Nisan 12, 2011 by Javascript

Article Information



This Javascript tutorial contains and tries to cover following subjects:
- Brief explanation of Javascript Logical Operators
- Example to Logical Operators in Javascript

Articles tries to provide answer to following questions and issues:
- How to check a more than one condition to execute a code in Javascript
- How to use AND, OR and NOT logic operators in Javascript code

Articles pre-requisites following information:
- General knowledge of variables in Javascript
- General knowledge of functions in Javascript
- General knowledge of HTML

Brief explanation of Javascript Array


In this javascript tutorial, we will try to cover javascript logical operators to understand how to use them to check more than one condition for executing a block of code.

IF we recall earlier example, we had used IF to check a condition, and depending its evaluation TRUE - FALSE, we had executed a code block. If we need to use more than one condition to check to execute a code block, logical operators are used. For example, we could say, if x is smaller than something and bigger than something, this is where we will need a logical operator.

There are 3 main logical operator in javascript. Those are:

AND: &&
OR: ||
NOT: !

Above signs are operator signs that javascript uses. Operators take one left and one right parameter as condition. They evaluate a result from two Boolean value. Logical operators work similar in javascript to other languages.

AND produces TRUE if left and right is both TRUE otherwise FALSE.
OR produces TRUE if one side is at least TRUE.
NOT: reverses result of TRUE - FALSE.

NOT is sometimes technically is called negation. It reverses the result of condition.


Example to Javascript If


Following example demonstrates javascript logical operators with example in HTML page.


USA citadel


In above javascript logical operators example, we created a variable and assigned its value "9". If statement checked three condition as separate execution, and printed its relevant code block result.



Data Layers
Area:programming \ languages \ javascript \ \ \
Ref:
Loc:articles
Tags: javascript
Related
#Updates:
#Blogs:
#Reviews:
#News:


Messages


Feedback:


63
pdf icon Pınned News

AI Citadels

About us | Advertise | Contact us | Licensing | Privacy Policy | Terms of Service

© 2001 AIcitadels. All rights reserved.


Layout: Fixed / Responsive / Old style