Maybe this is clearer if you use

````
validNames.forEach(function (name) {
````

and avoid the loop, i, var name, etc.