1. 1
    Hide Properties from Showing Up in "for ... in" Loops in JavaScript
    34s

Hide Properties from Showing Up in "for ... in" Loops in JavaScript

InstructorXiaoru Li

Share this video with your friends

Send Tweet

Sometimes we need to prevent some properties on a JavaScript object from being iterated over and accessed in "for ... in" loops.

In this lesson, we will learn how to use Object.defineProperty() to hide existing properties on an object by setting the property descriptor flag enumerable to false.