DEV Community

vishwasnarayanre
vishwasnarayanre

Posted on • Edited on

Learn why JavaScript

A brief about the Javascript

According to Stackoverflow, survey javascript is the most popular language and is always will be the most liked language in the developer space.
when you develop a website and you upload a set of files HTML, CSS, javascript and then when we start to run the files a script tag is being used for loading the javascript to the server, within the same folder or else with the "href" link having the file which is elsewhere on the internet (that is compatible for the development)
Javascript is one of the client-side programming languages that is used for running the program on the browser, each browser has a "Browser Engine" which is what it executes the code. This basically used for the Rendering (for the appearance), Transfer data, or fetch more data from the server.

We have heard of the different frameworks from the client-side(Front End Frameworks) like Vue, React, Angular or SVELTE which helps in writing reliable and maintainable code for the client-side. Traditionally unlike Java javascript is an interpreted language which is instead of going to compile steps it is just converted to machine code(Hex code to be very precise), browsers are added with the just in time compiler to speed up the engines.

Javascript was known as a slow interpreted language now software so fine-tuned that they can do any job like server, hardware optimized in such a way that it is used in building deployable machine learning solution(Tensoflow js), we can do a lot with the flavor of node.js for the backend like we can write APIs, interact with the database and talk to other servers.
node.js has the same V8 engine as chrome thus they are very fast
Even though the things which are better opted for the fast performance is just by using javascript, Go, and C++ for the fine-tuned and optimized performance.

let's talk about the syntax

Variables have single primitives or compound data.
Primitives are basically collection or number, string or text, or booleans, compound data is held by arrays and objects.
In javascript, we use let and const for declaring variables
Arrays are called lists in other languages as the clusters of the orders structured data.
Objects know as dictionaries in other languages are they are just used with the key and then the definition is obtained in the result.

In Javascript "The DOM" the document object, a javascript representation of the structure of our HTML an is present in the variable document when we load the page which is the collection of element objects. Thus knowing all this and knowing the basics of the development in the backend (the mechanism of the functions) and front end(aesthetics of the website like color, appearance) can be programmed using javascript through "Browser API"(a set of javascript methods).
Javascript is a "C-like" Language, we have loops, exception handling just like c++.

Speaking of loos we use a "for in loop" to iterate over an object and a "for of loop" to iterate over an array.

functions are any code that we want to use more than once which countries function names and the parameters as an input to the function.

Methods as used in calling some inbuilt or written function(functions written from the programmer)

functions can also be written as an arrow function

Another huge part of Javascript is called as Asynchronous programming which is asking more of the non-deterministic function like assign a request to fetch more data from the server, here is a scenario is for the fault tolerance where the data to can we fetch the data or is it not receiving the request(failure). Over the course of time javascript is seeing a lot of updates and has evolved but the current standards are for the async/await which is used in getting the fault tolerance in accessing the requirements for sending the request for fetching or transferring data.

Let's also talk about the typescript which gives the static types, unlike the vanilla javascript which has dynamic types. In typescript, we need to be specific about what kind of value is there in the variables as we can easily debug the error in the development phase itself, as it is very specific in the application.

Top comments (0)