Can you please help me with a couple of line of JS in "KeyB Accessible drop downs".

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Can you please help me with a couple of line of JS in "KeyB Accessible drop downs".

Hi
I have been studying navigation systems to increase my knowledge of web page authoring. And I found what I think is a good one however there is two lines of the JavaScript that is just making no sense to me. These two lines are marked in Orange in the JavaScript which drives the "Keyboard Accessible suckerfish drop downs" which can be found below. Essentially these two lines either concatenate some whitespace in front they've a members of an array which assigns special CSS classes to either a collection of LI tags or "A" tags. My problem with these lines of code is that it appears to me for all practical navigation systems the drop-down collections of LI tags and "A" tags would have to be at least two which means the condition of length greater than zero would always be met in the necessity for such a statement would be obviated. So I my understanding this line of code and the "Keyboard Accessible suckerfish drop downs" correctly or not. Please enlighten me with your thoughts.

It's saying "add <something> plus "sfhover" to the className property".
The <something> depends on whether the className property currently has a value. If it does, add a space, if it doesn't, add nothing.

It's saying "add <something> plus "sfhover" to the className property".
The <something> depends on whether the className property currently has a value. If it does, add a space, if it doesn't, add nothing.

If that is what that line is doing, would it be worse in any possible way you can think of just always to add a space no matter what?