Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created December 3, 2011 15:05
Show Gist options
  • Select an option

  • Save Raynos/1427331 to your computer and use it in GitHub Desktop.

Select an option

Save Raynos/1427331 to your computer and use it in GitHub Desktop.
make non enumerable
function makeNonEnumerable(obj /*, props */) {
var names = [].slice.call(arguments, 1);
names.forEach(makeNonEnumerable);
function makeNonEnumerable(name) {
var pd = Object.getOwnPropertyDescriptor(obj, name);
pd.enumerable = false;
Object.defineProperty(obj, name, pd);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment