10 JavaScript Function That You Should Know

10 JavaScript Function That You Should Know

Guys!! Today we are gonna discuss 10- JavaScript functions that will make your coding life way easier. Let’s dive into the main topic.

Difference Between Primitive Value and Reference Value

primitive values are data that are stored on the stack Primitive values are stored directly in the location that the variable accesses.

Try Catch Error Handling

Error handling is a very important thing for any type of programmer. it’s possible for a very expert developer to make mistakes in his code. but if you make a very little mistake in a very big code your entire code will die I mean stop working. to avoid this problem you got to use try tach. you can handle the error inside your code in a very nice way with try-catch. and also, you could print the error on the client-side or browser

finally Part of Try Catch

What finally does is, if you face any error in your code your entire code will be stoped there. the next code won't be executed until you fix this error. but if you use finally after catch then the code that you will write in finally will be executed all the time. Either you got the error or not. the code in finally most will be executed.

Coding Style

When you are coding you must have to be careful about your coding decoration. I mean your code must have to be decorated in a professional way so when someone else will work on your code he could understand your code. It’s really boring to format the codes after work manually. So to make your work more professional and organized you can use any extension to format your codes automatically. there’s a bunch of formatting extensions available out there. But if you want to know which one do I use for my coding I will say Prettier. It’s a really great tool to format your codes automatically.

Commenting Inside Coding

Commenting inside your coding is a very important thing. let’s say today you are working on a project which has thousands of line codes. after a few months when you will come here back to do something with codes that time it will be really tough to understand which code is doing what. but if you write comments before each function describing what this function is written for it will be easy to understand. You will find a lot of comments in each professional project.

Load balancing

Load balancing is defined as the methodical and efficient distribution of network or application traffic across multiple servers in a server farm. Each load balancer sits between client devices and backend servers, receiving and then distributing incoming requests to any available server capable of fulfilling them.

Client-Side Caching

What is client-side caching? Basically, Client-Side Caching is, when you are visiting a webpage your browser is saving that data in local memory. So that next time when you will visit that same web page your browser will provide you data faster.

Server-Side Caching

Once the user has made a request to a website, its data is stored on a server. Next time the user makes a request, it just gets back the saved data from the server saving time by not having to pull the data from the database.

Cross Browser

Cross-browser testing is the practice of making sure that the websites and web apps you create work across an acceptable number of web browsers. As a web developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, device, or additional assistive tools they are using. You need to think about:

JavaScript Variable Scope

JavaScript variable has two scopes. The first one is local scope. Local scope means is being limited in a certain area. and global scope means you can access this variable from anywhere in the documents.