@nomadshiba

also you can do `Record<PropertyKey, unknown>`
`PropertyKey` shorthand for `string | symbol | number`

@1DrowsyBoi

Type-safe language programmers: 

"Look what they need just to mimic a fraction of our power."

@abhayprince

I name it key instead of index.
{ [key:string] : unknown }

@youarethecssformyhtml

Deno helped me a lot to learn TypeScript and avoid some bad practices such as this one

@christianpuldon7201

For a split second I read "Stop using TypeScript"

@devperatetechno8151

thanks kyle, keep with the snippets of TS

@und0

you should mention the `object` (note lowercase) this is the most generic pure object you can specify, usually useful it you're extended a generic. function <T extends object>foo (bar: T) { return Object.keys(bar) }

@darshitgajjar5199

please make more and more shorts. I love your content

@audiodrocher

This! Thanks, Kyle

@thefanboy3285

The title made me think for a moment there was a trick in TS to get rid of the block scope delimiters "{" "}" lol

@Ba_Dashi

Programmer: tells the language that the argument should be an object.

Also programmer: passes a Date, which is by definition an object

"Woahh why is the labguage allowed this?"

@travispulley5288

Super helpful! Relaxes my brain to think of it this way

@andrewjarrett132

Record<string, unknown> won't exclude arrays though.

If you want to exclude arrays, you'll need to do `Record<symbol, unknown>`.

There are a few small corner cases where `Record<symbol, unknown>` is too strict, but those don't come up much in user-land.

@AdamLeis

I've been all up in Record<string, unknown> in the past months. It seems cleaner to my eyes for some reason than the key index approach (2nd version he showed).

@adityatripathi1904

Record<string, string>

@nomadshiba

Also you can still use it, its a great way to tell that something is anything but non nullable

@ffuego9751

These shorts are awesome, goat js/ts content creator

@rtpHarry

Great shorts normally but I never bump into this issue, which is confusing as you say "by far the most common issue". If it's being passed like that its normally more defined like as an interface, or as you recommend a type. I never go near the Object type directly.

@nostalgia5031

Doing “Record<string, unknown>” also works

@johnsoto7112

I love the record syntax over the 2nd one