diff --git a/front-end/interview-questions.md b/front-end/interview-questions.md index bb648a0d..77ce907f 100644 --- a/front-end/interview-questions.md +++ b/front-end/interview-questions.md @@ -1240,6 +1240,7 @@ For objects: - `for` loops - `for (var property in obj) { console.log(property); }`. However, this will also iterate through its inherited properties, and you will add an `obj.hasOwnProperty(property)` check before using it. - `Object.keys()` - `Object.keys(obj).forEach(function (property) { ... })`. `Object.keys()` is a static method that will lists all enumerable properties of the object that you pass it. +- `Object.getOwnPropertyNames()` - `Object.getOwnPropertyNames(obj).forEach(function (property) { ... })`. `Object.getOwnPropertyNames()` is a static method that will lists all enumerable and non-enumerable properties of the object that you pass it. For arrays: