Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript empty object check ES5

function isEmpty(obj) {
  for(var prop in obj) {
    if(Object.prototype.hasOwnProperty.call(obj, prop)) {
      return false;
    }
  }

  return JSON.stringify(obj) === JSON.stringify({});
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery.MultiFile 
Javascript :: title after load undefined nuxtjs 
Javascript :: javascript intl.datetimeformat brasil 
Javascript :: regex match only letters and numbers 
Javascript :: find document which is not in array 
Javascript :: angular rxjs-compat is uptodate 
Javascript :: jquery 1.6 jgrid pagging ejemplo 
Javascript :: wrap three three set div in a single div 
Javascript :: leap year javascript 
Javascript :: como saber si un afecha es mayor o menor js 
Javascript :: web3 js connect to ropsten 
Javascript :: convert javascript function to typescript online 
Javascript :: java script loop array 
Javascript :: remove property from query string javascript 
Javascript :: Dublin, Edinburgh, Lisbon, London getcurrentdatetime in angularjs 
Javascript :: Confirm the EndingPassed--Javascript 
Javascript :: bootstrapmaterialdatepicker get selected value on changes 
Javascript :: javascript swap 
Javascript :: scrollto element by id 
Javascript :: format currency javascript 
Javascript :: react date component with word month 
Javascript :: common library for .net and node js for encryption 
Javascript :: Reactjs class exemple componentDidMount 
Javascript :: how to Initialize and fill an array with the specified values in javascript 
Javascript :: remove last word over a limit javascript 
Javascript :: Play Gif or Video On hover Jquery 
Javascript :: Implicit Return Shorthand in javascript 
Javascript :: paramters and arguments 
Javascript :: trigger many calls JS 
Javascript :: nodejs Websocket chat room 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =