Why does the following code trigger "Expected an assignment or function call and instead saw an expression." in JSHint? I thought this was the correct way to protect a block from executing if a particular variable or variables are not defined...
!function($) {
"use strict";
// jQuery-based code here
$('.test').show();
}(window.jQuery);
!function($){"use strict";}(window.jQuery);
triggers the error and(function($){"use strict";}(window.jQuery));
not. And a function call has higher priority than the!
operator in javascript. - Prusse