Top-5-javascript-oneliners ...(h3manth.com)3 points·by init0·14 yıl önce·2 commentsh3manth.comTop-5-javascript-oneliners ...http://h3manth.com/content/top-5-javascript-oneliners 3 commentsPost comment[–]portmanteaufu·14 yıl öncereplyI don't consider something like:function is_empty(obj){if(obj instanceof Array){return obj.length===0;}else if(obj instanceof Object){for(var i in obj)return false;return true;}else return !obj;to be a one-liner simply because it was crammed into one line.[–]abderrahmane·14 yıl öncereplyLoL[+]chubbyheckler·14 yıl önce
function is_empty(obj){if(obj instanceof Array){return obj.length===0;}else if(obj instanceof Object){for(var i in obj)return false;return true;}else return !obj;
to be a one-liner simply because it was crammed into one line.