High level overview of JAVASCRIPT
Hey people π, welcome to my new article. In this article I have discussed how JavaScript behaves as a programming language. So, let's dive in π.

Definition of javaScript
- JavaScript is a high-level, prototype-based object-oriented, multiparadigm, interpreted or just-in-time compiled, dynamic, single-threaded, garbage-collected programming language with first-class functions and a non-blocking event loop concurrency modelπ.
I am sure this definition went above your head π if you are a beginner and reading it for the first time. Well in my case it went above my head when I read it for the first time but thanks to "Jonas Schmedmann" who answered all my doubts. So let's understand what each word in the above definition meansπ.
A high-level language
Javascript is a high-level language which means it has a higher level of abstraction over the machine code. Even if we compare javascript with other programming languages such as c, c++ or java it has a higher level of abstraction over these languages as well.
By abstraction, I mean that internal details are hidden and just important information is known to us. Let's understand this with an example.
So we all know to run a code on our computer we need some hardware resources such as memory and CPU. So, what happens in languages that have a lower level of abstraction such as C, we have to manually manage these hardware resources. For example, asking the computer for memory to create a new variable.
On the other hand in languages that have a higher level of abstraction such as javascript, we do not have to worry about manually managing these hardware resources at all because these languages have an abstraction that takes all of that work away from us. This makes the language easier to learn and use, but the downside is that the programs written in javascript are not as optimized and are not as fast as the programs written in C++ language.
Hope you got a better idea about what a high-level language means π.
Garbage Collection
In low-level languages such as C language, we have to manually manage the memory using memory management primitives such as
free()andmalloc()In JavaScript, we have a powerful tool that takes memory management away from the developers. It is an algorithm inside the javascript engine which automatically removes old unused objects from the computer memory
You can imagine garbage collection as the cleaning guy who helps in cleaning unused memory.
Multiparadigm
Paradigm refers to the style or approach of writing the code to solve any given problem in a particular programming language.
Three popular paradigms are
1). Procedural programming
2). Object-oriented programming
3). Functional programming
Many programming languages are only procedural or only object-oriented or only functional. For example, Erlang supports only functional programming and C# supports only object-oriented programming. On the other hand, javascript supports all these paradigms. So, javascript is very flexible and versatile and hence it is known as a multiparadigm language.
Interpreted or just in time compiled language
We know that machine does not understand the English language. It only understands combinations of 0's and 1's. So we just need a way to convert our code written in any programming language into machine code (a combination of 0s and 1s). There are two ways in which we can convert our code into machine code 1) Interpretation and 2) Compilation.
Interpretation:- Here the interpreter runs through the source code and executes it line by line. The execution step includes converting the line into machine code then executing it and then moving to the next line.
Compilation:- Here, the compiler converts the entire source code into machine code and then executes it.
Javascript used to be interpreted language but the problem with the interpreted language is that they are much slower than compiled language. with the fully-fledged application that we built today, slow performance is not acceptable. So, instead of interpretation, the javascript engine uses a mix between compilation and interpretation which is called just-in-time compilation. Hence javascript is interpreted or just-in-time compiled language.



