document.ready() function confusion

document.ready() function confusion

Hi.
I am novice to JQuery and i am having difficulty understanding this concept. When we are talking
about document.ready() function we say that

  1. $(document).ready(function()
  2. {
  3. //some code
  4. }); 

is equivalent to
  1. $(function()
  2. {
  3. //some code
  4. });
When we look at the jQuery documentation, something like this is written there.

  1. else if ( jQuery.isFunction( selector ) ) {
  2. return rootjQuery.ready( selector );
  3. }
This is what handles the part written above. I am not able to understand this. Please help clarifying this
confusion.
Thanks,
Peter