View Single Post
Old 03-26-2012, 02:22 AM   PM User | #2
Nile
Regular Coder

 
Nile's Avatar
 
Join Date: Jun 2008
Posts: 280
Thanks: 2
Thanked 46 Times in 46 Posts
Nile is an unknown quantity at this point
You can be less repetitive like this:
Code:
function empty(obj){
   return (typeof obj == 'undefined' || obj === null || obj === '') || (typeof obj == 'number' && isNaN(obj)) || (obj instanceof Date && isNaN(Number(obj)));
}
Nile is offline   Reply With Quote