Is there a difference in performance (I am not asking about readability) if I condense my code into one line versus two?
For example:
var slide = 'images/' + n + '.png';
$('img').attr('src',slide);
versus
$('img').attr('src','images/' + n + '.png');
Personally, I like fewer lines of code. Often, I am the only one reading my code, so communicating intent is not as important.
I am curious if the Javascript interpreter executes one of the above options faster (even though this is a classic micro-optimization example).