views:

74

answers:

1

I have the following 2 lines of code:

var minusID = settingID + '-minus';
$('#' + minusID).removeClass("selected");

How can I efficiently combine this into one line?

Thanks

+8  A: 
$('#' + settingID + '-minus').removeClass("selected");

Can't think of anything much better than that, but you shouldn't worry about that, lines-of-code isn't really a concern any more...

Kobi
In fact, I would argue that readability (and thus maintainability) is a much bigger concern than number of lines.
cpharmston
I really don't think that this is any harder to read, and we don't have an extra variable hanging around that doesn't carry it's own weight. +1
Rob
thanks all that worked for what I was looking for.
AnApprentice