Length of a JavaScript associative array
No, there is no built-in property that tells you how many properties the object has (which is what you’re looking for). The closest I can think of are two ES5 and higher features, Object.keys (spec | MDN) and Object.getOwnPropertyNames (spec | MDN). For instance, you could use Object.keys like this: console.log(Object.keys(quesArr).length); // “3” Object.keys returns … Read more