home ~ projects ~ socials

Get The Number Of Items In A JavaScript Object

// This needs to be tested and an example made

const widget = {
  'alfa': 1,
  'bravo': 2,
  'charlie': 3
};

const count = Object.keys(widget).length;
-- end of line --