Why JavaScript is being so popular?

Shuvasish Talukder Shuvo
3 min readMay 5, 2021
Power of JavaScript
Power of JavaScript

First of all, What is JavaScript?

JavaScript is a multi paradigm, single threaded, JIT, first class function, garbage collected programming language.

Hold on! You might ask what’s that ?

well, multi paradigm means the pattern of coding. In JS there have 3 types of programming pattern.

1. Procedural programming

2. Functional programming (current pattern of react components)

3. class based programming ( earlier pattern of react components)

Single threaded means programs are run one after another. JIT (just in time) compiled actually compensate single threaded functionality . JIT run the programs once and make a small executable file that can be execute any time.

First class function is a features of this language. Not every language supports first class function. It means that we can pass a function as an argument of another function. That is really so powerful. Most of the time we use this feature.

For example, in map method we always pass an callback function.

[‘this’, ’is’, ’a’, ’example’].map( function( i ) {

console.log( i );

})

here map is a function(Array method), in this function we are passing another function as an argument.

garbage collected means that we don’t need to clean the unused data manually. Behind the scene, language itself clean those for us.

Behind the scene, How JavaScript works?

JS has a callstack and a heap.

callstack tracks which function is currently running and it’s variable environment. If another function invoked, then currently running function will be paused and newly invoked function will placed the top of the stack. After the execution of this function, it will be disappeared from the callstack and immediate paused function will run again.

Then what is the purpose of heap?

Heap is a type of container, that is connected with callstack. It holds all kind of object here. Sometimes object might become really large, that’s why callstack doesn’t hold object for performance issues.

JavaScript has two types of data.

1. Primitive type

2. Reference type

Primitive types data are string, number, bigint, boolean, null, undefined. Those data are stored in callstack and each have an memory address in callstack.

On the other hand, reference type data are object, array. Those are stored in heap. Each object gets an memory address in heap and that memory address is linked to another memory address in callback. that’s why it’s call reference type data. For this reason we call still add/delete properties in object even though it has been declared as const.

Current programming trends

Before node js, JavaScript was not able to use to write server side programs. Now node JS along with npm makes a whole new world for JS developers. So, Developers don’t need to learn a new language for writing server side programs.

Wait, what about mobile apps?

No need to worries. You will get hands full of JavaScript framework/library for making mobile applications. React native is one of the most popular JS library for making great mobile applications. Desktop applications can be also build with JavaScript. Our favorite VS code editor is also build with JavaScript.

What are you waiting for?

Just learn JavaScript and rule the software industry.

If you have come that far, than thanks a lot. :)

--

--