JS%2B2 - Logical Operators Tests two or more relationships...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 170  Javascript 2 Prof. Jim Appenzeller speaker@rci.rutgers.edu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Arithmetic Operators Symbols of basic arithmetic operations: Division / Multiplication * Addition + Subtraction –  we can group operations with parentheses  Multiply and divide are performed before add and subtract JavaScript does not have an operator for exponents We call “Binary operators” those that operate on two values Eg   a+b Unary operators operate on one value eg increment ++   and decrement – (two minuses) can be prefix (--a) or postfix (a++) 
Background image of page 2
Assignment  Operators = += -= *= /= < Less than <= Less than or equal to > Greater than >= Greater than or equal to == Equal to != NOT equal to Comparison Operators
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Logical Operators Tests two or more relationships at the same time Teenagers are older than 12 and younger than 20 Logical AND Symbol is &amp;&amp; Result of (a &amp;&amp; b) is true (a bool) if both a and b are true; else the result is false Logical OR Symbol is || Result of (a || b ) is true if either a or b are true; else if BOTH are false, the result is false Logical NOT Symbol is ! It is a unary operator; its result is the opposite logical value of the value it is applied to Comments in JS Single Line comment: // your comment Multi-line Comment: /* your comment */...
View Full Document

Page1 / 5

JS%2B2 - Logical Operators Tests two or more relationships...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online