Here, I would rather use:
```js
if (NAMED_HTML_ENTITIES.hasOwnProperty(entityName))
```
so that, for example, using `&hasOwnProperty;` raises an error.