JavaScript is a scripting/programming language which allows the programmer to implement complex and dynamic things in a web page. Some common examples of where you might have seen JavaScript being execute on a page is when a web page displays timely updates, animated graphics, interactive maps, scrolling videos, etc. It allows for a more dynamic and interactive user experience. JavaScript is the third layer when it comes to making a website. Above it you have HTML and CSS which give the visuals and structure of how the website will look. JavaScript adds the dynamic and interactive elements.

Just like any programming languages, JavaScript has many of the same functions they do. These include storing values in variables, operating on strings, and being able to execute code when an event occurs. One of the main attractions of JavaScript though is Application Programming Interfaces (APIs) which provide more options when coding in JavaScript. APIs are like libraries in the sense that they are building blocks a developer can use to implement programs which would be much difficult otherwise. API’s will fall into one of two categories: Browser APIs and Third-party APIs.

Browser APIs are integrated into the web browser and expose data from the computer environment. Some examples include the DOM API, Geolocation API, Canvas and WebGL, and Audio and Video APIs.

Third Party APIs are APIs not built into the browser and to access them you must get it from somewhere on the web. Some examples are Twitter API and Google Maps API.

Java and JavaScript

First, Java and JavaScript are two separate programming languages. Learning to program with one does not mean you know how to program with the other. The main similarity is that JavaScript code looks like Java. However, JavaScript does not have Java’s strong type checking. Originally, JavaScript was called LiveScript but was changed later because of how it follows a lot of Java’s naming conventions, expression syntax, and basic control-flow constructs.

Another difference is Java’s has a compile time system of classes, where as JavaScript supports a runtime which involves several small data types. JavaScript is also a much more free-form language compared to Java. You can ignore private, public, and protected methods and you do not have to declare all classes, variables, and methods.