DEV Community


Discussion on: How to Get an Object Length

krumpet profile image
Ran Lottem • Edited

Great write-up!

I've used getOwnPropertyNames in the past, along with recursive calls on an object's prototype, to get all of the properties that object has and that it inherited.

samanthaming profile image
Samantha Ming Author

Yup that's great use case to use getOwnPropertyNames. I think the key is knowing what you want and picking the right tool for it. Thanks for sharing your use case! 👍