Expected an assignment or function call and instead saw an expression
问题 I'm totally cool with this JSLint error. How can I tolerate it? Is there a flag or checkbox for it? You get it when you do stuff like: v && arr.push(v); as opposed to: if (v) { arr.push(v); } Both do the same exact thing. If you put: window.test = function(v) { 'use strict'; var arr = []; if (v) { arr.push(v); } return arr; }; into the minifier it minifies down to this anyway: window.test=function(a){var b=[];a&&b.push(a);return b}; 回答1: I don't think JSLint has an option to turn that off.