DEV Community

Cover image for Introduction to Javascript
jamilu jibrilla
jamilu jibrilla

Posted on

Introduction to Javascript

What is JavaScript?

if you are trying to decide what programming language to learn, this article will give you an insight on the JavaScript language and some of the things that you can achieve using JavaScript.

JavaScript is a scripting language that is used to develop websites. Used with HTML and CSS it is one of the core technologies used when creating websites.

While HTML and CSS are used to markup text and style your websites respectively, JavaScript helps bring your website to life by adding interactivity to the site, this way a user is able to communicate or interact with contents on the site.


A brief history

During the late 1990's, people only had static websites (meaning you cannot interact with a website, stuffs like listening to events and adding interactivity to a website was not possible, you can only browse and read information from the web).

JavaScript was created in 1995 by Brendan Eich, it was initially created to solve this particular problem of having non-interactivity on the web. Today, JavaScript has evolved from a language that was only being used on the browser to a widely used language that can run almost everywhere, it now runs on a server or any device that has a special program called JavaScript engine.

Browsers by default has an embedded engine called JavaScript virtual Machine(JVM) , you might be asking, what is a JVM?

The JavaScript Virtual Machine is a software component used to execute JavaScript code

  • The engine reads the code.
  • It then converts it to machine language.
  • The machine language then runs fast.

Some features of JavaScript

JavaScript is an interpreted language (meaning it doesn't need a compiler to translate your code into machine language before it can be executed), it runs directly in your browser.

compiled languages are read and translated into a machine understandable code before being executed, while an interpreted language is executed line by line as the program reads it.

JavaScript is a dynamically typed language, this mean you do not need to explicitly define the data type of variable you are creating, it also means that you can override or change the data type of a variable at any time. Programs written in JavaScript are called scripts.

Is JavaScript different from Java?

Many assume the relation between the two languages because they have similar names, but JavaScript and java are two different languages. When JavaScript was created initially, it was called mocha and then later it was renamed to liveScript and JavaScript eventually. read more

What is JavaScript Used for?

You can do a lot with JavaScript this days, from adding interactivity to your websites, to setting up and configuring your server or even creating a robot machine.

Below are some few things you can achieve using JavaScript:

Adding interactivity to your websites by:

  • Dynamically changing the contents(HTML) of a webpage
  • Modifying the contents of a webpage.
  • Change existing styles of a webpage.
  • Show or hide existing contents on a webpage
  • Display animations.

Building web servers and developing server applications.

Apart from using JavaScript on the frontend to develop your website/app. Developers can use JavaScript to build simple web servers using node JS.

Game development
You can use JavaScript to create games that run in your
browser. This is a great way for developers to practice their skills.

One of the advantages of JavaScript is that it runs almost everywhere, you can run JavaScript on any device that has a JavaScript engine.

Summary

  • Programs written in JavaScript are called scripts.
  • It is a core tool required in building websites/webapps.
  • JavaScript was first created as a language to be used on the browser to create interactive websites, which later evolved and is now used in different environments.

in my next article, we will discuss about some of the basic and fundamental concepts of JavaScript.

Top comments (0)