UNPKG

820 BMarkdownView Raw
1# get-own-enumerable-property-symbols [![Build Status](https://travis-ci.org/mightyiam/get-own-enumerable-property-symbols.svg?branch=master)](https://travis-ci.org/mightyiam/get-own-enumerable-property-symbols)
2
3Returns an array of all *enumerable* symbol properties found directly upon a given object.
4
5Similar to [`Object.getOwnPropertySymbols`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols)
6but only [enumerable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) keys.
7
8```js
9import getOwnEnumPropSymbols from 'get-own-enumerable-property-symbols'
10
11getOwnEnumPropSymbols({ [Symbol()]: undefined })
12// [Symbol()]
13getOwnEnumPropSymbols(Object.defineProperty({}, Symbol(), {enumerable: false}))
14// []
15```