Why javascript the most popular programming language

rusiru
4 min readFeb 19, 2021
© 2021 Copyright PureLogics LLC

JavaScript was the number one most popular programming language in 2019. It is also not even close to the language. It was five years ago. Almost everything has changed for the better, from where it can run to the language’s actual syntax. As we go into 2020, I explained about JavaScript.

When you load any page on the internet, your computer sent a folder of files, including at least one HTML file. This HTML file can load JavaScript with a script tag for me in the same folder or elsewhere. Java Script is the only client-side language meaning. It waits for the execute code. It is on your computer using a program called.

The browser each browser has its engine, which is what executes. The code, among other things, client-side code can change. The display sends data or fetches more data from the server. You might have heard of client-side frameworks like react angular or view. which build on top of JavaScript and make reading client-side code a lot easier and more maintainable, but that is another video traditionally.

JavaScript is an interpreted language meaning. The code is read line by line instead of having to go through a compile step. Where it is converted to machine code. Browsers have added something called. the just in time compiler, though, to speed up. Their engines, while JavaScript was known as a slow language in the past, computers are so fast. Now that is hardly the case anymore. JavaScript is doing pretty much everything.

These days from running servers to machine learning and more. We can do much stuff on the backend. Now with the JavaScript environment known as node JS, that means. We can write API to databases and other servers, all with JavaScript. Node uses the same V8 engine as chrome. Hence, it is lightning fast still things that are very performance-intensive are going to better off with go, or C++ let us talk about the language itself variables hold either single-cell primitives or compound data primitives are usually numbers Boolean Zora strings of text.

In contrast, compound data is held by arrays and objects in modern JavaScript. We use the keywords, let and const to declare variables. If you plan to change it later use, let us otherwise use const arrays, also known as lists. Other languages are just multi-celled ordered clusters of data objects, also known as dictionaries, and other languages are pretty much what they sound like you give it a word. It retrieves the definition. For example, if I give it the key name, it will retrieve Aaron the Dom or document object most important in java scripts.

It is a JavaScript representation of the structure of our HTML. It is present in the variable document when we load the page. The document object contains many element objects through the Dom. We can search for specific elements, add user event listeners or change how the page looks. All this possible through a set of methods called the browser API. We will get two methods soon JavaScript a C, like a language, meaning it steals most of its syntax from C. This includes if statements for loops while loops and more speaking of loops most commonly. We will use a for-in loop to iterate over an object, and a for-of loop to iterate over an array function are just any code.

We want to use more than once we declare these with the particular keyword function followed by whatever. We want to name our function and, finally, the parameters or inputs to our function. You can think of them as variables that are set later. When we use our function will also want to return something which will be the output or result of our function call a function with its name and bypassing in inputs as arguments methods are the same as function except they are attached to different data types we call these methods with the dot notation. The function can also be written like this parameters are on the left. It returns automatically. If we write on one line, arrow functions are used in array methods, which take a function as an argument and run that function on every item in the array. Do not worry. That is as complicated as getting another massive part of JavaScript, known as asynchronous programming or performing non-deterministic operations. Such as a network request to a server to fetch more data. We do not know. When the request returns, or it will fail, we have to handle both cases sync.

Programming has evolved a lot over the years in JavaScript. Still, the current standard is async wait, and it is fantastic. All you have to do is add the awake keyword, and it will pause your program when you send a request until that request either comes back or fails. While not technically JavaScript, I also have to mention typescript, which compiles into regular JavaScript. Vanilla JavaScript has what is known as dynamic types or no types. Typescript gives us static typing, meaning we have to be specific about what kind of value is in a variable. This seems like extra work, but it helps us catch a ton of errors. Finally, let us talk about NPM, the node package manager chances are if you need some code someone else has already written it, you can download it as a module, and chances are well tested and bug-free.

--

--