home ~ socials ~ projects ~ rss

Get The Number Of Items In A JavaScript Object

February 2025
// 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
Share link:
https://www.alanwsmith.com/en/2s/h4/w9/fl/?get-the-number-of-items-in-a-javascript-object