How to get all of the keys in a javascript object #shorts

preview_player
Показать описание

My VSCode Extensions:
- theme: material community high contrast
- fonts: Menlo, Monaco, 'Courier New', monospace
- errors: Error Lens
- extra git help: Git Lens
- tailwind css intellisense
- indent rainbow
- material icon theme
- prettier & eslint
- ES7+ React Snippets

------------

Комментарии
Автор

I use this all the time to loop through json data. Super useful!

walteredmond
Автор

I use this all the time 🎉 extremely important to know

jvcss
Автор

It's probably best to use "key" as the map loop variable for the audience this video would be most helpful to. The shorthand `name` object property assignment syntax here could be confusing

mickmister
Автор

I think Theres also a ES5 or 6 Method that Returns key value pairs as 2D array

WlkthroughWizard
Автор

thanks for this. im now practicing objects at javascript

pipzkydoo
Автор

Thats nice 👍..love watching these cool tips .. thank you

kurei
Автор

Pro tip: for Bob, Jane, and Rick, make them objects. For hasPaid as a collection of people objects with paid status, make them maps. Maps are more performant than objects and have less meta properties. You can also iterate if you need to.

MrPlaiedes
Автор

Sorry, i have a question (it's not a topic, i guess it's nevermind), so... what extension are you using to display errors on the row?

dkorjey
Автор

Could you please provide the extension name which shows error next to the wrong code in JavaScript!

maneeshguptanalluru
Автор

thanks for this, could you please share how you get your json with colors in the terminal output? I see bob and jane are green but mine are all white even though I'm using zsh on a mac and the zsh-syntax-highlighting plugin.

ComisarioLobo
Автор

Where do you get objs variable in the last console.log?

maserati
Автор

The actual new thing for me was that maps take the key and put it into the object.

shekishral
Автор

You should mention Object.values() and .entries() the latter being very powerful especially in combination with .fromEntries(). Always love declarative programming, imperative simply sucks

und
Автор

I WISH TO HAVE THAT COURSE

_PANALIGAN

JohnWilsonPanaligan-jeft
Автор

How the hell Object.keys.map(name => ({name}) returned {name: 'bob'}... ??? Should not be {bob:'bob'} ?

Odisej