Javascript while iterate over the object so how to know the key is parents object key or child object key
1 min readJul 10, 2019
When we iterate over an Object using for (key in obj) loop so we also get parent object key example —
we have Object.keys() method which only return the current object key not parent object keys.
This question is also asked in interviews. If you like my post please give a clap.