IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesJavaScript  Print This     

Unary Operators (JavaScript and Delphi Prism Cross Reference Guide)

By Mike Prestwood

JavaScript versus Delphi Prism: A side by side comparison between JavaScript and Delphi Prism.

 
Operators
 

A language symbol used for assignment, comparison, computational, or as a logical.

Unary Operators

[Other Languages] 

General Info: Unary Operator

An operation with only one operand (a single input). Common unary operators include + plus, - minus, and bitwise not. Some operators can function as both unary and binary operators. For example, + and - operators can serve as either.

Languages Focus

What unary operators are supported in additoin to the standard plus, minus, and bitwise not.

JavaScript: 

An operation with only one operand (a single input). JavaScript unary operators include ++ and --. They can be used either before or after a variable as in: a++, b--, and ++a, and --b.

Examples:

iCounter++;
iCounter--;
 
++iCounter;
--iCounter;
Syntax Example:
var iCounter=0;
 
for (iCounter=0;iCounter<=5;iCounter++)
{
document.write("Count is " + iCounter + "<br>");
}
Delphi Prism: 

The obvious Prism unary operators are +, -, and Not.

+ Plus
- Minus
Not Bitwise Not
Inc() Increment
Dec() Decrement

Syntax Example:
var i: Integer := 1;
Inc(i);
MessageBox.Show("" + i);  //Displays 2












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]