JavaScript Assignment Operators

Perform Assignment Operations In JavaScript

Assignment types can be arithmetic, logical, bitwise, shift, and compound operators.

JavaScript assignment operators are used to assign a value to a variable or an expression.

An operand is the object of a mathematical operation. Operands for the assignment operators can be integers or real numbers.

Assignment Operators For JavaScript

JavaScript Assignment Operators

Ojamboshop.com Learning JavaScript Assignment Operators
Name Description Example
= Set left operand to same value on right num1 = num2
=+ Addition num1 += num2
-= Subtraction num1 -= num2
*= Multiplication num1 *= num2
/= Division num1 /= num2
%= Modulus num1 %= num2
**= Exponentiation num1 **= num2
&= Bitwise AND num1 &= num2
Name Description Example

JavaScript Assignment Operators Snippet

// OjamboShop.com Learning JavaScript Assignment Operators Tutorial //
let num1 = 5;
let num2 = 3;
let num_add = num1;
num_add += num2;
let num_sub = num1;
num_sub -= num2;
let num_mul = num1;
num_mul *= num2;
let num_div = num1;
num_div /= num2;
let num_mod = num1;
num_mod %= num2;
let num_exp = num1;
num_exp **= num2;
console.log(num_add); // Console Displays 8
console.log(num_sub); // Console Displays 2
console.log(num_mul); // Console Displays 15
console.log(num_div); // Console Displays 1.66
console.log(num_mod); // Console Displays 2
console.log(num_exp); // Console Displays 125

JavaScript Assignment Operators Code
OjamboShop.com Web IDE JavaScript Assignment Operators Code

JavaScript Assignment Operators Result
OjamboShop.com Web IDE Displaying JavaScript Assignment Operators Result


Usage

You can use any IDE or text editor and the web browser to compile and execute JavaScript code. For this tutorial, the OjamboShop.com Learning JavaScript Course Web IDE can used to input and compile JavaScript code for the assignment operators.

Open Source

JavaScript follows the ECMAScript standard and is licensed under the W3C Software License by web browser vendors and runtime environment vendors. This allows commercial use, modification, distribution, and allows making derivatives proprietary.

Learn Programming Courses:

Courses are optimized for your web browser on any device.

OjamboShop.com Learning JavaScript Course
OjamboShop.com Learning JavaScript Interactive Online Course

OjamboShop.com Learning Python Course
OjamboShop.com Learning Python Interactive Online Course

OjamboShop.com Learning PHP Course
OjamboShop.com Learning PHP Interactive Online Course

Limited Time Offer:

OjamboShop.com is offering 20% off coupon code SCHOOL for Learning JavaScript Course or Learning Python Course or for Learning PHP Course until End Day 2024.

Learn Programming Ebooks:

Ebooks can be downloaded to your reader of choice.

OjamboShop.com Learning JavaScript Ebook
OjamboShop.com Learning Python Ebook Cover Page

OjamboShop.com Learning PHP Ebook
OjamboShop.com Learning PHP Ebook With Sample Page

OjamboServices.com App Development
OjamboServices.com App Development Banner

Conclusion:

JavaScript makes it easy to use the assignment operators. Use assignment operators for numerical calculations and manipulations.

Take this opportunity to learn the JavaScript, Python or PHP programming language by making a one-time purchase at Learning JavaScript Course or Learning Python Course or Learning PHP Course. A web browser is the only thing needed to learn JavaScript, JavaScript or PHP in 2024 at your leisure. All the developer tools are provided right in your web browser.

If you prefer to download ebook versions for your reader then you may purchase at Learning Python Ebook or Learning PHP Ebook

For custom websites, app development and one-on-one tutorials, go to OjamboServices.com.

References:

Leave a Reply

Your email address will not be published. Required fields are marked *