For some reason I can't get the succinct flow control syntax to work with jQuery. The following throws an error:
$(this).hasClass('expanded') && return
Whereas this longer version works fine:
if ($(this).hasClass('expanded')) { return}
Any ideas why the first one is throwing an error?