- It adds interactivity to HTML pages
- It is a scripting Language
- Light-weight script
- It can be embedded directly to HTML page.
- It is an interpreted language
- It is FREE to use.
- Real name is ECMA script
- Making HTML pages dynamic and interactive.
- Data validation
- Detecting browser and serving specific content to the visitor.
- Creating cookies.
- Inside the <head> tag
- Inside the <body> tag
- Inside both <head> and <body>
- In External files.
- It is case sensitive.
- At the end of each executable statement, semicolon (;) is used (Optional).
- Can be commented using //…and /*….*/.
- There are arithmetic operators which are used to perform arithmetic between and/or values.
NOTE: The + operator can be used to concatenate two variable values. Adding two strings OR a number and a string will result in a string. Where as adding two numbers will result in a number.
- There are comparison operators which are used in logical statements to determine equality or difference between variables or values.
eg: = =, !=, = = =, < , >,>=, <=, etc.
- There are logical operators used to determine the logic between variables or values.
eg: &&, ||, ! ,etc.
- There are conditional operators used to assign values to a variable based on some conditions.