Explanation of JSHint's Bad line breaking before '+' error

It's a style guide to avoid statements that could be liable to assumptions about automatic semicolon insertion.

The idea is that you make it clear by the end of a line whether the expression ends there or could be continued on the next line.


Jshint wont flag this as a bad line break if you use the + before the line break as opposed to in the new line. Like so:

window.location.href = String1 +
'#' +
Sting2 +
'=' +
String3;