getOwnPropertySymbols + getOwnPropertyNames

# Axel Rauschmayer (12 years ago)

rwaldron/tc39-notes/blob/master/es6/2013-09/sept-18.md#consensusresolution-1

Honest question: Is there any use case where you would not want to iterate over both?

If yes then I’d prefer to have getOwnPropertyKeys (in addition or instead of getOwnPropertySymbols).

# Andrea Giammarchi (12 years ago)

I hope in addiction, since at least getOwnPropertyNames is slightly polyfillable ... having only a method that exposes both makes migration more painful, imho

# Jeff Morrison (12 years ago)

IIRC the purpose of separating the two was to encourage the idea that you should not normally iterate over both (because symbols will often be used to publicly obfuscate properties on an object).

Originally symbol keys were not enumerable at all. However it was hard to show that enumerating symbols should "never" happen -- and so a separate api was made to make it possible-but-more-inconvenient.