How does .first() work?

How does .first() work?

Hello all,

suppose, that I have two divs with IDs:

#nav and #content

...and #nav comes first in the DOM.


Which one is selected by:

  1. $('#content, #nav').first() 

?

i.e. is the first one in the DOM selected, or the first one in the selector?


Thanks in advance!