Saturday, 17 September 2016

JavaScript Operators

jscript.png

Hello JavaScript Geekies! Good day! In our tutorial today , we'll be discussing JavaScript Operators. Let us take a look at this example and we analyze it:

var x; // declare a variable xx = 5; // assign a value of 5 to x

The first line above declares a variable x, ready for assignment (to contain an item/data). The second line assigns 5 to x.

Analysis

5 is the data put in x, and "=" is called the assignment operator (used to assign a value to a variable).

Take a look at another example:

var x, y;x + y = 5;

In the example above, x and y are called Operands while + and = are called Operators.

Further Analysis

  • + is called the Addition operator and it is one of the Arithmetic operators
  • = is called the Assignment operator, used for ‘putting’ a value in a variable (container).

Got question(s)? Leave comment(s) here which will be responded to as soon as possible, or drop a message with 08132690608 on WhatsApp to get added to the JavaScript Geekies group.

1 comment:

Your response mean a lot to us. Drop one.