Skip to content
Subhajit Sahu edited this page Dec 8, 2022 · 12 revisions

Get the number of keys in an object.

Similar: size, isEmpty.


function size(x)
// x: an object
const object = require('extra-object');

var x = {a: 1, b: 2, c: 3};
object.size(x);
// → 3


References

Clone this wiki locally