/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isEmpty(obj) { if (typeof obj == 'undefined' || obj === null || obj === '') return true; if (typeof obj == 'number' && isNaN(obj)) return true; if (obj instanceof Date && isNaN(Number(obj))) return true; return false; }