Skip to main content
Post Closed as "Duplicate" by Matt javascript
Question Protected by bummi
Notice removed Reward existing answer by Geeky Guy
Bounty Ended with johndodo's answer chosen by Geeky Guy
Notice added Reward existing answer by Geeky Guy
Bounty Started worth 50 reputation by Geeky Guy

is Is object empty?

whatWhat is the fastest way to check if aan object is empty or not?

isIs there a faster and better way thenthan this:

function count_obj(obj){
    var i = 0;
    for(var key in obj){
        ++i;
    }
    
    return i;
}

is object empty?

what is the fastest way to check if a object is empty or not?

is there a faster and better way then this:

function count_obj(obj){
    var i = 0;
    for(var key in obj){
        ++i;
    }
    
    return i;
}

Is object empty?

What is the fastest way to check if an object is empty or not?

Is there a faster and better way than this:

function count_obj(obj){
    var i = 0;
    for(var key in obj){
        ++i;
    }
    
    return i;
}
Source Link
clarkk
  • 1
  • 76
  • 228
  • 370

is object empty?

what is the fastest way to check if a object is empty or not?

is there a faster and better way then this:

function count_obj(obj){
    var i = 0;
    for(var key in obj){
        ++i;
    }
    
    return i;
}