Use [] to find tag! Example: [flutter, javascript]

Dart Basic Programming
Dart Basic Programming

Chapter 5

Assignment Operator

remove_red_eye 2405 Times
spellcheck 640 Words, 1595 Characters

Assignment operator is an operator that assigns addition, subtraction and arithmetic operators to a variable. This operator is very often used in the process of making applications, because it is used very well in summarizing code.

Cheat Sheet


= Assigns a value to a variable
+=

Gives a value to a variable by adding the operation to that variable from the contents of the right variable.

Example: 

A = A+B can become A += B

??= Assigns a value to a variable when the right-hand variable is null
-=

Gives a value to a variable by subtracting the variable from the right side of the variable.

Example:

A = A-B could become A-=B

*=

Gives a value to a variable by multiplying that variable from the contents of the right variable.

Example:

A = A*B could be  A*=B

/=

Gives a value to a variable by dividing the variable from the right side of the variable.

Example:

A = A/B could be  A/=B

Code Example

Here is a sample code. If it can't be opened please go to here

Next Article (Logical Operator)
Content Navigation