In this blog, I will try to give you a general view of javascript which will help you understand javascript better.
In this blog, we will see
What is javascript?
Why do we even use JavaScript?
why do people find it difficult to understand javascript
What is javascript?
So the first thing before starting to learn about javascript,is that has no relation with Java, they used to call it javascript because Java was very popular at that time. Now let's know what javascript is. So in simple words, javascript is a single-threaded synchronous programming language.
Now you might be thinking what does the term single-threaded and synchronous mean? so let's start by understanding the term single-threaded.
single-threaded programming language executes only one piece of code at a time. In a single-threaded language like JavaScript, code execution happens on a single call stack. This means that only one piece of code can be executed at a time, and any other code that needs to be executed has to wait until the currently executing code has been completed.
Now turn to synchronous, a synchronous programming language is a programming language where code is executed in a synchronous, or blocking, manner. This means that the program waits for each operation to complete before moving on to the next one. In other words, each operation is executed one at a time, and the program does not move on to the next operation until the current one has been completed.
Advantages of javascript
ok so now we had a bare understanding of javascript let's see what are the benefits of javascript. why is it so popular? why should you learn it
Now you know that Javascript is a single-threaded synchronous language. Single-threaded languages are simpler to understand and easier to reason about, as there is only one thread of execution. This makes it easier to write code that is predictable and reliable.
Also, javascript is versatile in terms of where you can use it for different purposes. It can be used for a wide range of tasks, including building web and mobile applications, creating server-side applications, and even controlling hardware devices such as robots and drones. There's a lot you can do with javascript.
Apart from that javascript has a large community for support. You might be thinking why would you need community support? The important thing in programming is this, you can never expect that you know everything about a particular language or framework or library etc. While learning and building you will face situations where you will realize that you cannot understand what is happening and it's fine. Because our knowledge is limited but what you can do is go into the community of people who use the same tech stack and ask your doubts. Someone who faced the same situation in the past would help you understand things in a better way. So having a large community is an important factor.
These are some of the many benefits of javascript and that's why it is so popular among developers.
Javascript is not loved?
Even though javascript is so popular and people use it widely for a variety of purposes but still many developers don't love javascript. They find it difficult to understand its behavior. Reason being they don't understand the fundamentals clearly. If you wanna learn and understand the language there are certain topics you should have a better understanding of
What is execution context and how javascript executes around it
Hoisting in Javascript?
What is the lexical environment?
What are closures?
What are promises?
Asynchronous javascript
How the javascript engine executes the javascript?
These are some topics that helped me understand the language better. the possible doubt you might be having is what is asynchronous javascript because in the beginning javascript was said to be a synchronous language and it is the opposite of that. Well, javascript is a synchronous language but there are some built-in features and browser APIs that help it perform asynchronously.
Ok with that I tried to give a general overview of the language with the knowledge I had. I hope this helps you to improve your understanding, if there is any doubt or anything for improvements for me, I would love to know your views.
Summary
In this blog, we learned what is javascript. What are the advantages and why you should learn it? Why developers don't love the language and what can help you to understand the language better ๐.