Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!


Implied eval. Consider passing a function instead of a string

When do I get this error?

JSHint (version 1.0.0 and above) will throw the "Implied eval. Consider passing a function instead of a string" error when it encounters a call to the setTimeout or setInterval functions in which the first argument is a string. Here's an example that should pop up a browser alert after one second:

This is the equivalent of the JSLint and older JSHint "Implied eval is evil. Pass a function instead of a string" warning. More detail can be found on the page for that message.

In JSHint 1.0.0 and above you have the ability to ignore any warning with a special option syntax. The identifier of this warning is W066. This means you can tell JSHint to not issue this warning with the /*jshint -W066 */ directive.


comments powered by Disqus