JavaScript object literal length === undefined?

This is supported in node.js and newer environments.

var obj = {a: "a", b: "b"};
Object.keys(obj).length // 2

Leave a Comment