Thanks for commenting, i agree, but i don't prefer using for ... in, since i have to also have a check in place using .hasOwnProperty to find only the properties and methods you assigned to the object.
Some comments have been hidden by the post's author - find out more
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.
You can iterate over the keys of an object using
for ... in. Same as you can ierate over the indices (i.e. keys) of an array.Thanks for commenting, i agree, but i don't prefer using
for ... in, since i have to also have a check in place using.hasOwnPropertyto find only the properties and methods you assigned to the object.