JavaScript is one of the most popular languages which includes numerous features when it comes to web development. It's amongst the top programming languages as per Github and we must know the features of JavaScript properly to understand what it is capable of.
Some of the features are lightweight, dynamic, functional and interpreted. Now we are going to discuss some important features of JavaScript.
Light Weight Scripting language
Dynamic Typing
Object-oriented programming support
Functional Style
Platform Independent
Prototype-based
Interpreted Language
Async Processing
Client-Side Validation
More control in the browser
Let's see all of these features in detail so that you can understand them. Some of the above-specified features are old JavaScript features while some of them are new features.
1. Light Weight Scripting Language
JavaScript is a lightweight scripting language because it is made for data handling at the browser only. Since it is not a general-purpose language so it has a limited set of libraries. Also as it is only meant for client-side execution and that too for web applications, hence the lightweight nature of JavaScript is a great feature.
2. Dynamic Typing
JavaScript supports dynamic typing which means types of the variable are defined based on the stored value. For example, if you declare a variable x then you can store either a string or a Number type value or an array or an object. This is known as dynamic typingTo understand this, in languages like Java, we explicitly mention that a particular variable will store a certain type of data, whereas in JavaScript we do not have to provide the data type while declaring a variable. In JavaScript, we just have to use var or let keyword before the variable name to declare a variable without worrying about its type.