---
title: "Get Object Size"
description: "Calculate the number of keys in an object in TypeScript."
date: "2025-10-02"
tags: ["typescript","object","size","frontend"]
canonical: "/snippets/typescript/object/object-size"
---

import { Code } from '@astrojs/starlight/components'
import Source from './object-size.ts?raw'

# Get the size (number of keys) of an object

<Code code={Source} lang="ts" title="object-size.ts" wrap />
