Javascript tutorial





Javascript, often abbreviated as JS, it is a programming language that conforms to the ECMAScript specification. Javascript is high-level, often just-in-time compiled and multi-paradigm. It has curly bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.

What is javascript?


Javascript was initially created to “make web pages alive”.

The programs in this language are called scripts. They can be written in a web page’s HTML and run automatically as the page loads.

Scripts are provided and executed as plain text. They don’t need special preparation or compilation to run.

Why is it called javascript?


When javascript was created, it initially had another name “Livescript”. But java was very popular at that time, so it was decided that positioning a new language as “younger brother” of java would help.

But as it evolved, javascript became a fully independent language with its own specification called ECMAScript, and now it has no relation to java at all.



Today javascript can execute not only in the browser, but also on the server, or actually on any device that has a special program called the Javascript engine.

What makes javascript unique?


There are at least three great things about javascript:

  • full integration with HTML/CSS
  • simple things are done simply
  • support by all major browsers and enabled by default

What is javascript used for?


  • Adding interactive behavior to web pages
  • Creating web and mobile apps
  • Building web servers and developing server applications
  • Game development

Why use javascript over other programming languages?


  • Javascript is the only programming language native to the web browser
  • Javascript is the most popular language
  • There’s a low threshold to get started
  • It’s a fun language to learn

Hello world in javascript


<!DOCTYPE html>
<html>
	<head>
		<title>Page Title</title>
	</head>
	<body>
	<script language="javascript" type="text/javascript">
    	document.write("Hello world");
    </script>
	</body>
</html>

Javascript basics

Javascript examples