JavaScript : Expected and assignment or function call and instead saw an expression
问题 I am using JSHint to ensure my JavaScript is "strict" and I'm getting the following error: Expected an assignment or function call and instead saw an expression On the following code: var str = 'A=B|C=D' var data = {}; var strArr = str.split( '|' ); for (var i = 0; i < strArr.length; i++) { var a = strArr[i].split('='); a[1] && (data[a[0].toLowerCase()] = a[1]); // Warning from JSHint } Any ideas why I'm getting such an error or how I can code to remove the error. 回答1: Here is a simplified