Update article.md

"return `undefined`" -> "returns `undefined`"
This commit is contained in:
Peter Roche 2020-02-10 23:02:31 -07:00 committed by GitHub
parent bad9ca5465
commit 59861ad2e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,7 +225,7 @@ alert( Symbol.keyFor(sym) ); // name
alert( Symbol.keyFor(sym2) ); // id
```
The `Symbol.keyFor` internally uses the global symbol registry to look up the key for the symbol. So it doesn't work for non-global symbols. If the symbol is not global, it won't be able to find it and return `undefined`.
The `Symbol.keyFor` internally uses the global symbol registry to look up the key for the symbol. So it doesn't work for non-global symbols. If the symbol is not global, it won't be able to find it and returns `undefined`.
That said, any symbols have `description` property.