Length of an object

Run Settings
LanguageJavaScript
Language Version
Run Command
function getObjLn(netstructure){ let ln = 0; if (typeof netstructure != 'object') return null; for (let key in netstructure){ ln++; } return ln; } const baseObj = {a: 'null', b: 'string'}; console.log(getObjLn(baseObj)); console.log(Object.keys(baseObj).length);
Editor Settings
Theme
Key bindings
Full width
Lines