JavaScript Introduction

What is Javascript?

Javascript (JS) is a high-level, interpreted programming language used in web development.

It is a language which is also known as dynamic, loosely typed and multi-paradigm.

Along with HTML and CSS, Javascript is one of the three main technologies of the World Wide Web.

Brief history of Javascript

JavaScript was created by Brendan Eich(a Netscape Communications Corporation programmer) in 1995.

Eich took only 10 days to develop the scripting language known as Mocha.

When it was first delivered, it was made for Netscape Navigator and quickly became popular as LiveScript.

The name was changed to JavaScript later on to reflectNetscape’s support of Java within its browser.

It was a “marketing strategy” to connect a brand new language (JavaScript) to a widely popular language (Java), regardless of that JavaScript and Java have nothing in common.

At that time, there were two dominating web browsers i.e., Netscape Navigator (with JavaScript) and Internet Explorer (with JScript).

By 1996, JavaScript’s popularity grew so much that it was handed over to an international standards scripting language body called ECMA (European Computer Manufacturers Association) that is responsible for the development and upkeep of this language.  

So the scripting language was officially named as ‘ECMAScript’. However people still call it JavaScript.

Usage of JavaScript

  • Client-side validation
  • Dynamic drop-down menu
  • Displaying date and time at any moment
  • Validate user input in an HTML form before form submission(sendingthe data to a server)
  • Build forms that respond to user input without involving a serverrequest
  • Change the appearance of HTML elements
  • Open, close and redirection of new windows or frames
  • Manipulate HTML layers  likehiding, moving, and allowing the user to drag them around a browser window
  • Build complete client side programs
  • Displaying popup windows and dialog boxes (e.g., alert dialog box,confirm dialog box and prompt dialog box)
  • Displaying clocks

Advantages of JavaScript

  • Speed. Client-side JavaScript is very fast because it can be run without  server-side access.
  • Simplicity: JavaScript is easier to learn and implement.
  • Popularity:  JavaScript is used almost everywhere in web design and development industry. StackOverflow and GitHub have many projects using Javascript. The language has gained a lot of traction in the industry in recent years.
  • Interoperability: JavaScript can be inserted into any web page regardless of the file extension or inside scripts written in other languages like Perl and PHP.
  • Server Load: Being client-side reduces the demand on the website server thereby decreasing overall load.
  • Rich interfaces: Drag and drop components or slider gives a rich interface to your website with the use of JavaScript.
  • Extended Functionality: Third party add-ons like Greasemonkey has enabled JavaScript developers to write of JavaScript snippets that can be executed on desired web pages to extend its functionality.
  • Versatility: There are many ways to use JavaScript through Node.js server nowdays e.g., if it is bootstrap node.js with Express, a document database like mongodb must be used. JavaScript is also used in the front-end for clients. It is possible to develop an entire app from front to back end using only JavaScript.
  • Updates: Since the advent of EcmaScript 5, ECMA International has dedicated to continue updating JavaScript annually.

Disadvantages of JavaScript

  • Client-Side Security: As the code is executed on the users’ computer, in some cases it can be exploited for malicious purposes which are not desirable.
  • Browser Support: JavaScript is interpreted differently by different browsers whereas server-side scripts will always produce the same output. Client-side scripts can be a little unpredictable.

Note: There are services out there that will allow you to test your code automatically on check in of an update to make sure all browsers support your code.

Latest version of JavaScript

The latest version of JavaScript (ES7) is supported by the updated versions of Google Chrome and Mozilla Firefox.