Getting data locally is always faster than the getting data from server. There are different types of caching mechanism that can be used to cache data on browser for optimizing performance and faster data retrieval. We will see some of the data store that can be used on client to cache or store data.

1. Session Storages

This is a very well-known storage on browser. Commonly uses to session specific data on this store. We can infer a current tab as one session. Session storage will not be available across tabs or new tab. …

Your are at right place if you are :

  • working on loading huge amount of data from server be it JSON or XML document
  • getting truncated JSON Response string
  • observing $.ajax call failure due to JSON.parse is compiling about invalid char while parsing JSON
  • observing performance lag while parsing JSON using $.ajax
  • observing response code 200 but there is not response received in $.ajax success call

If you are loading large data from server then you need to consider lot of factors impacting load time. There can be optimization on server as well as client. Coming to client, most commonly…

When you are coding for sample program you might not come across the unexpected behavior. But whenever you start writing an production code, you have to account for the unexpected behavior due to incorrect data, failure in code etc. What come to your mind when you talk about handling unexpected behavior in code? If you are thinking try/catch/finally then you will definitely get what we will be discussing in this blog. If you are not aware of try/catch you can read here.

Some times it is difficult to relate asynchronous style of coding but if you relate it with your…

So you read title and you were able to relate it because of word resolve or keep. Please let me know. You might be thinking if resolve was intentional in title. Answer is yes. People promise all the time, some keep them and some don’t that all depends on condition they are in.

Similarly, in JavaScript world too promises are prominent entity. Promises are very similar to promises in human world as far as action of keeping (resolving) promise and not keeping (rejecting) promise are concerned. JavaScript simply call these two states as fulfilled (resolved) and rejected. …

Whenever you are writing code in Javascript, the Most common point comes where you and your code reviewer comes to a point to write fail-safe code. When we are talking about fail-safety, the prominent use case comes to check null, undefined, and empty text values. It is very important to handle these values in order not to come across a code failure at runtime. If there are use cases where your variables attain null or undefined you will be in a position to understand and handle it.

In JavaScript, the state with no value is represented by null or undefined

Tirumal Sutrave

I'm a software developer by profession. I like to read tech stuff. I try to share my experiences from my learnings.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store