What is JavaScript?
Most loved programming language by programmers.
JavaScript is one of the most popular languages which was founded by Brendan Eich in 1995. So, there’s still one question why it is one of the most popular languages among programmers. So, let’s see the facts which make it one of the most popular language -
- Most of the famous frontend frameworks are developed on JavaScript, like (Angular, React).
- JavaScript which was in the past used for adding functionality for the frontend is now even used in making the backend, so the programmer can do the frontend and backend with one language only, some backend framework technologies are (Node.js, meteor).
- There are some great resources to learn JavaScript, some of the materials are (Mozilla, Free Code Camp, YouTube Video).
- JavaScript has one of the best communities which provide the solution to most occurring problems, some of the websites are (Stack Overflow, dev).
- Features and functionality provided by JavaScript are great and easy to learn and are in demand, if you are thinking of it then sure go for it, you won’t regret it.
How should we get started to learn JavaScript?
- Learn the basic syntax, functions, and concepts, like (hoisting, keywords- (let, const, var)).
- Implement the concepts in small programs and have a solid grip on basics.
- Create projects and start implementing the ideas and don’t forget to learn new concepts during the project.
Let’s see how JavaScript works?
Whenever we click that green run button JavaScript creates an execution context and everything in JavaScript happens inside an execution context. Execution context contains the 2 most important component which is memory component (Variable Environment) and another one is code component (Thread of Execution) we got to know which component is there, but we don’t know what are they for and what is their functions-
- Memory Component - In the memory component, we map all functions and variables to their respective values in the form of the (key: value) pair, and the memory component is also known as variable environment. The memory component is created for the program when it is executed then in some cases, the memory component can also be created again if there is the function calling or other stuff in the code then a new execution block will be created which will be having its own memory and code component and again the memory will be allocated for the variables and the functions in the memory component of the newly created execution block.
- Code Component - In the code component the code is executed one by one sequentially as per the flow of the code, JavaScript is synchronous and single-threaded language, synchronous means that we will execute the code in the specific order it is written or meant to execute and single-threaded means that a single line of code will be executed at a time in the code component in execution block, but if we need to run the multiple operations at the same time then it is not possible with JavaScript, but we still use it because there is a way to make JavaScript asynchronous in nature using promises and async callbacks methods to achieve asynchronous JavaScript.
What are the benefits of using asynchronous JavaScript?
Benefits of using asynchronous JavaScript are -
- Increases the performance and responsiveness of the application we are building, particularly when we have long-running operations that do not require to block the execution. In that case, we can perform the other work while waiting for the result from the long-running task.
- Organize your code in a neat and readable way significantly better than boilerplate code of the traditional thread creation and handling. With async/await, you write less code and your code will be more maintainable than using the previous asynchronous programming methods such as using plain tasks.
That’s all for now and keep now coding!!