JavaScript is a scripting language and can run on both clients and servers.

Similar as the other programming languages, JavaScript can be learnt from the following aspects: variables, data types, operators, reserved words, basic operations including loops, conditionals, etc.

Object is a very important data type in JavaScript, everything in JavaScript can be regarded as or be thought as an object when you do programming.

Some key points of JavaScript:

  • :bell: Always put the JavaScript codes in a .js file and link it in the HTML page.
  • :bell: In most cases, you need to manipulate the DOM using JavaScript.
  • :bell: A lot of libraries, frameworks and tools can be utilized for JavaScript programming.

A typical example code of JavaScript:

var div = document.getElementsByTagName("div")[0];
div.addEventListener("click", function() {
	alert("Hello World!");
});
#=> pop up an alert box saying "Hello World!" when you click a div

Search and check out the comprehensive JavaScript book for reference :book: JavaScript: The Definitive Guide for more info about JavaScript. And the same basic and comprehensive JavaScript knowlege base is :link: Mozilla Developer Network. The JavaScript official website is :link: ECMAScript. If you have questions, you can drop me an email :e-mail: below.