JavaScript Operators

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Logical Operators

&& logical and || logical or ! logical not

Multiplication operator

(*) multiplies numbers. var x = 5; var y = 2; var z = x * y;

Addition operator

(+) adds numbers: var x = 5; var y = 2; var z = x + y;

Addition assignment Operator

(+=) adds a value to a variable. var x = 10; x += 5; equals 15

Arithmetic Operators

Arithmetic operators are used to perform arithmetic on numbers: + Addition - Subtraction * Multiplication / Division % Modulus ++ Increment -- Decrement

Assignment Operators

Assignment operators assign values to JavaScript variables.

String Operators

The + operator can also be used to add (concatenate) strings. The += assignment operator can also be used to add (concatenate) strings.

What does the concatenation operator do?

The concatenation operator adds strings together.

Assignment Operator

The symbol =, which is used to store a value in a variable

True or false: If you add a number and a string, the result will be a string?

True

Type Operators

typeof Returns the type of a variable instanceof Returns true if an object is an instance of an object type


Kaugnay na mga set ng pag-aaral

Nutrition Test #3 - Exercise and Diet

View Set

Chapter 16 SB Gene Regulation in Bacteria

View Set

Nutrition and Disease Exam 1 part 4

View Set

Technology for Success Module 6 Quiz (Security and Safety)

View Set

Penny Review Chapter 14: MSK and Breast

View Set

Unit 3 Study Guide The Gilded Age/Progressive Era

View Set

Presidents of the Philippines; Achievements and contributions

View Set

SHONA,Culture/Tsika,Ukama/Kinship

View Set