Reading-notes

Programming with JavaScript

- JavaScript includes following categories of operators like:

Arithmetic operators are used to perform mathematical operations between numeric operands:

- Comparison Operators

JavaScript language includes operators that compare two operands and return Boolean value true or false : ### - Logical Operators Logical operators are used to combine two or more conditions. JavaScript includes following logical operators:

- Assignment Operators

JavaScript includes assignment operators to assign values to variables with less key strokes.

-Ternary Operator

JavaScript includes special operator called ternary operator :? that assigns a value to a variable based on some condition. This is like short form of if-else condition.

Functions:

** JavaScript functions ** are used to perform operations. We can call JavaScript function many times to reuse the code.

** There ** are mainly two advantages of JavaScript functions :

* Defining functions:

For example , the following code defines a simple function named square:

** function square(number) { return number * number; } **

* we use functios with httml to make the page live as we see in this example we create a button and we named it “click” and we called the function as we click the button the function will return to us the value who will show at the screen :

## and here we go :