How to always return a default value for an object property in javascript?

Standard

Hi Guys,

Do you have a need where you want to return something as a default value if your JS object don’t have that property?

Let’s come to our problem.

Lets take an object (kind of a key value configuration object) which is coming from server and we need to make some very important decision based on this data.

var electricalConfig = {
  isLightOn: true,
  isBoardSmart: false,
  noOfSwitch: 10,
  noOfSockets: 3,
  isConnected: true
};

Continue reading

Web apps with no internet :) Beginner’s Guide for application cache

Standard

Hello Guys,

In this modern world, website are essentials. Have you wondered what if you have to read some article or use some web application while you are moving in train or bus and you have no internet? What if you provide this feature to your user? Answer is : This will be a great user experience to them.

What if your user doesn’t have to download your website content each time they visit? Don’t you think this experience will be much far faster than before? Again answer is YES in capital letters.

Let’s see approach.

Continue reading

Atom Editor packages behind the corporate firewall

Standard

Are you in love with brand new code editor from github team?  Yes it’s atom!

Atom editor is opensource and fully customizable in terms of installing packages and plugins to help us with whether its a debug tool, code snippets or anything else. We have bunch of free packages from the community.

But what about installing these packages behind the firewall? As we are not allowed to access URLs in our offices. So for this purpose we use proxy settings that relaxed us with url access.

Continue reading