Why is JSHint throwing a “possible strict violation” on this line [duplicate]

Trying to validate some Javascript in JsHint, and I get the following:

Possible strict violation:

return ($.event.dispatch || $.event.handle).apply(this, args);

Any ideas why it's throwing that error?

Thanks guys

Answers:

Answer

JSHint isn't sure whether the function that code is in will be called with an actual this.

To tell JSHint how the function will be called and suppress this warning, add /*jshint validthis: true */ to the top of the function.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.