Introduction to JavaScript: Basics

shalitha senanayaka
4 min readMar 6, 2021

--

What is Javascript?

JavaScript is a very powerful client-side scripting language. Then next question, What is a client-side scripting language?

A client-side scripting language, in simply client-side programming mostly deals with the user interface with which the user interacts on the web. It is mostly a browser, in the user’s machine.

JavaScript is used mainly for enhancing the interaction of a user with the view of the web. In other words, you can make your webpage more lively and interactive, with the help of JavaScript.

Javascript History

Brendan Eich

JavaScript was developed by Brendan Eich in 1995 at Netscape Communications. He co-founded the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation, and served as the Mozilla Corporation’s chief technical officer and, briefly, as its chief executive officer.

In initial prase called named Mocha, but quickly became known as LiveScript and, later, JavaScript.

JavaScript vs Java

Javascript and Java are completely different. If you are a programmer, in your language JavaScript != Java. Java is a server-side language and used in a wide range of places, including Android apps, in the creation of desktop applications and web enterprise applications.JavaScript is reserved for developing client-side scripts.

  • Java code must be compiled, and JavaScript code is all-text.
  • Java is an OOP (object-oriented programming) language, and JavaScript is specifically an OOP scripting language.
  • JavaScript code is run on a browser only, while Java creates applications that run in a virtual machine or browser.

JavaScript Today

Every entry-level programmer’s question is it still worth learning JavaScript today?

We can answer it by simply, According to the 2020 StackOverflow developer survey, JavaScript is the most commonly used programming language for the eighth year in a row.

https://insights.stackoverflow.com/survey/2020#most-popular-technologies

JavaScript has now made its way to the server-side developments (thanks to Node.js), mobile devices (thanks to React Native and Ionic), and desktop (courtesy of Electron).

V8 is actually a JavaScript engine. Here we go again, What is a JavaScript engine, and What is V8?

JavaScript engine is a program or an interpreter which executes JavaScript code. All popular browsers have their own implementation of a JavaScript engine. Here are some popular JavaScript engines.

  • Chrome’s V8 engine — V8 is Google’s open-source high-performance JavaScript and WebAssembly JIT engine, written in C++. It is used in Chrome and in Node.js, among others. V8 can run standalone or can be embedded into any C++ application.
  • Firefox’s SpiderMonkey
  • Safari’s JavaScriptCore
  • Edge’s Chakra (but Edge has recently embraced Chromium‘s V8 engine)

This is the piece of software that highly optimizes your JS code and converts it into machine code for the CPU to execute. Some of the tasks V8 handles are:

  1. Garbage Collection
  2. Inline caching
  3. Pointer compression
  4. Compilation to Machine code
  5. and much much more optimization

Then, we move to our real topic, Javascript today. The major reason for its popularity is the fact that JavaScript is versatile and can be used for both frontend and backend development as well as for testing websites or web applications as well.

Top Front End JavaScript Frameworks

  1. React.js
  2. Vue.js
  3. Angular.js
  4. Ember.js
  5. Preact.js
  6. Svelte.js

Top Back End JavaScript Frameworks

  1. Express.js
  2. Next.js
  3. Gatsby.js
  4. Nuxt.js

Top Testing JavaScript Frameworks

  1. Jest
  2. Mocha
  3. Jasmine

Wrapping It Up!

So there you go, your first step into the world of JavaScript. We’ve begun with just Introduction, to start getting you used to why you’d use JavaScript and what kind of things you can do with it.

--

--

shalitha senanayaka

I’m Shalitha, Software Engineer who loves to code 24/7. For more information, feel free to reach me at www.shalitha.info