JavaScript Tutorial


JavaScript Introduction


Our JavaScript Tutorial is designed for both beginners and professionals.

JavaScript is a lightweight, interpreted programming language that allows us to build interactivity through dynamic web pages.

It is a client side scripting language that executes in the user's browser.

It is used to create client-side dynamic pages.

It is an object-based scripting language which is lightweight and cross-platform.


Advantages of JavaScript

1. Less server interaction

2. Immediate feedback to the visitors

3. Increased interactivity

4. Richer interfaces


Limitations of JavaScript

1. It does not allow the reading or writing of files.

2. It cannot be used for networking applications.

3. It doesn't have any multithreading or multiprocessor capabilities.



Applications of JavaScript

1. Client-side validation

2. Dynamic drop-down menus

3. Display date and time

4. Display pop-up windows and dialog boxes

5. Display clocks


It can be implemented by placing JavaScript statements within the <script> tag. The <script> tag alerts the browser program to start interpreting all the text between these tags as a script.

We can place our JavaScript code in 3 places:

1. Between the head tag of html

2. Between the body tag of html

3. In a separate JavaScript file

It ignores spaces, tabs and newlines that appear in a JavaScript program.

It allows us to omit the semicolon at the end of a statement if we place each statement in a separate line but it is recommended to use a semicolon after the statements.

It is a case-sensitive language.


Comments in JavaScript

Single line comment: Any statement between // and end of line is considered as a comment.

Multi line comment: Any statement between /* and */ as well as between is considered as a comment.