JavaScript Tutorials for beginners

Introduction to JavaScript

JavaScript is commonly used as a client-side scripting language that allows web developers to improve the functionality and appearance of web pages.
It can generate content dynamically when a page is accessed by the user.
JavaScript is widely used in front-end development, while Node.js allows JavaScript to be used on the server side.

Let's have a glimpse at a simple JavaScript program that output the text "Hello World!" in an HTML5 document
	<!DOCTYPE html> 
<!--Example 1: Hello.html -->
<html>
<head>
<title> A simple JavaScript program </title>
<script type = "text/javascript ">
document.writeln(" <h2>Hello World!</h2>");
</script>
</head>
<body></body>
</html>
Here is how it looks on the browser:

Hello World in JavaScript


JavaScript code is case-sensitive and is usually between the head tags of an HTML5 document. The <script> tag specified to the Web browser that the code written here is a script. Double quote or single quote can be used to contain a string of characters.

Statements end with a semicolon. The write method writes a line of characters in the HTML5 document to be displayed by the browser. The alert method, which can be written without the prefix window displays an alert box with a message in it. The escape sequence \n indicates the new line and the plus sign + indicates joining two strings. A comment line is preceded with a double forward bar "// but multiline comments use delimiers and hence start with the delimiter /* and finish with */.

Keywords in JavaScript have specia meaning and can not be used by the developper for different purpose. For example the keyword var is used to declare variables before they are used, and where each one should have a type and a value. A variable name to be considered as a valid identifier, it can neither be a JavaScript reserved keyword nor start with a digit. Characters to use to declare name variables include digits, dollar signs, letter, and underscore.

Topics Covered:

  1. Assigning a value to a variable and interacting with the user


  2. Mathematical operations


  3. Decision Making


  4. Loops


  5. More examples on Loops


  6. How JavaScript simplies the use of Aritmetics


  7. Multi Selection using the Switch


  8. Break Statement


  9. Continue Statement


For more details, please contact me here.