Archive for the ‘javascript’ Category

How to test for an empty javascript object

Hi everybody! I’ve just had a discussion of how to test for an emtpy javascript object. As a result, I have several code snippets and I want to share them with You.

Problem

alert({}==null); // false
alert({}=={}); // false
alert({}=={}); // false
alert({}==0); // false
alert({}==""); // false
alert({}==[]); // false
// etc :)

So, none of the expressions above can check for an empty javascript object.

Read the rest of this entry »

Search
Categories
Archives

You are currently browsing the archives for the javascript category.

Advertisement
Artisteer - Web Design Generator