exercism/exercism.io — pull request #1430 by drueck (2014-02-26 02:10:43+00:00)
Title: Update JavaScript word-count final test to only check for "constructor"

My previous change to the tests implied that "prototype" and "keys" would cause the same issue as "constructor" in that an empty JavaScript object would return something other than `undefined` if you tried to access a property of that name, but it turns out my assumption was incorrect, so I updated that final test to just test that the code correctly counts "constructor" as I know that special case exists. Sorry for the extra PR. :/

```javascript
$ node
> var counts = {};
> counts["constructor"]
[Function: Object]
> counts["prototype"]
undefined
> counts["keys"]
undefined
```

Also, I've noticed that in certain circumstances jasmine expects objects that it is comparing to have the `hasOwnProperty` method, and so in order to make sure the example will reliably pass the tests, I modified it slightly not to use `Object.create(null)`, but just `{}` and `hasOwnProperty` to ensure that the particular object instance has the property in question rather than using the square bracket syntax.