## JAVASCRIPT Theory

#### Introduction

*1961*

##### History of JAVASCRIPT language

javascript object model introduced in 2000. Javascript was invented by Brendan Each at Netscape and has appeared in all browsers since 1996 JavaScript was supposed to be a glue language for those parts and to also make HTML slightly more interactive. There are two principles for JavaScript: * ECMA-262 is facilitated by Ecma Worldwide. It is the essential norm. * ISO/IEC 16262 is facilitated by the Global Association for Normalization (ISO) and the Universal Electrotechnical Commission (IEC). This is an auxiliary norm.

#### Example Javascript program :

<head>

<title> My First JavaScript code!!!</title>

<script type="text/javascript">

alert("Hello World!");

</script>

</head>

<body>

</body>

</html>

#### Applications

- It is used to Navigation systems
- Javascript enhances Web pages with dynamic and interactive features
- Java script gives HTML designers a programming tool Javascript runs in client software .
- It is used in Web pages to create cookies

#### Keywords

There are only 60 keywords available in 'JAVASCRIPT'

Abstract | Boolean | Break | Byte | Case | Catch | Char |

Class | Const | Continue | Debugger | Default | Delete | Do |

Double | Else | Enum | Export | Exports | False | Final |

Finally | Float | For | Function | Goto | If | Implements |

Import | In | Instanceof | Int | Interface | Long | Native |

New | Null | Package | Private | Protected | Public | Return |

Short | Static | Super | Switch | Synchronized | This | Throw |

Throws | Transient | True | Try | Typeof | Var | Void |

Volatile | While | With | yield |

#### Arithmetic Operators

The following table shows all the arithmetic operators supported by the Javascript. Assume variable A holds 5 and variable B holds 10 then

Operator | Description | Example |
---|---|---|

+ | Adds two operators | A + B = 15 |

- | Subtracts second operand from the first | A - B = 5 |

* | Multiplies both operators | A * B = 0 |

/ | Divides numerator by de-nominator | B/A = 0.5 |

% | Modulus operators and remainder of after an integer division | B % A = 0 |

++ | increment operator increases the integer value by one. | A++ = 11 |

-- | Decrement operator decreases the integer value by one. | A-- = 9 |

#### Logical Operators

following table shows all the Logical operators supported by the Javascript. Assume variable A holds 1 and variable B holds 0 then

Operator | Description | Example |
---|---|---|

&& | called Logical AND operator. If the both operands are non-zero.then the condition becomes true. Subtracts second operand from the first. Multiplies both operands.Divides numerator by denominator. | (A && B) is false. |

|| | called Logical OR operator.If any of two operands is non-zero.then the condition becomes true. | (A||B) is true. |

! | called Logical NOT operator.It is used to reverse the logical state of its operand.If a condition is true.then logical NOT operator Will make it flase | !(A && B) is true. |

#### Relational Operators

The following table shows all the Relational operators supported by the Javascript . Assume variable A holds 10 and variable B holds 20 then

Operator | Description | Example |
---|---|---|

&& | called Logical AND operator.If the both operands are non-zero.then the condition becomes true. Subtracts second operand from the first. Multiplies both operands. Divides numerator by denominator. | (A && B) is false. |

|| | called Logical OR operator.If any of two operands is non-zero.then the condition becomes true. | (A || B) is true. |

! | called Logical NOT operator.It is used to reverse the logical state of its operand.If a condition is true.then logical NOT operator Will make it flase | !(A && B) is true |