What Is Javascript?

If you’re an Internet user, chances are you have stumbled upon a website that makes use of the client-side programming language javascript. It’s used to create dynamic web applications that run on a browser’s engine (e.g., V8 for Chrome and Edge, Chakra for IE, or SquirrelFish for Safari). The language also is behind features that you’ve probably grown to expect from the web—such as Facebook timelines that automatically update on your screen or Google suggestions based on the letters you’ve started typing.

Aside from enabling all that cool functionality, javascript is considered a lightweight programming language because it uses little CPU power and has a minimalist syntax, which makes it easy to learn. In addition, it provides functions that help simplify code and allows developers to add features to their websites without having to write them from scratch.

It is a scripting language that can be embedded directly into HTML and CSS pages or referenced via a separate.js file, and when a visitor opens that page in their browser, the javascript is executed along with the HTML and CSS code to display a functional webpage. Unlike server-side programming languages, javascript is not compiled to machine code before it’s sent to a visitor’s computer—it’s interpreted as the code is read.

Because of the way it’s interpreted, javascript runs very quickly. This is because it utilizes a technique known as just-in-time compilation, which means that the language is compiled into machine code right before it’s executed, rather than ahead of time like C and other compiled languages. This enables simple functions and processes to be performed very quickly.

The other big feature that javascript offers is inlining, which helps improve performance and reduce the number of function calls that are made. For example, in this snippet of code, if the function add(a,b) is called often, the engine may decide to replace it with an expression that returns a + b, which will eliminate several function calls and significantly improve performance.

In addition, javascript has support for object-oriented programming concepts such as recursion and overloading. This is useful for creating objects that have multiple methods or functions, or for calling functions that are defined in another scope or function.

Lastly, javascript has support for arrow functions, which are shorthand for writing code that defines functions as anonymous objects. This can be helpful for simplifying code and improving efficiency, but it is important to note that arrow functions must be surrounded by parenthesis or they won’t be invoked. This can lead to bugs, and some developers prefer to avoid using arrow functions when possible.