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.
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! π
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.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! π