jQuery.get method : trying to understand source code

jQuery.get method : trying to understand source code

  
  1.   get: function( url, data, callback, type ) {
  2. // shift arguments if data argument was omited
  3. if ( jQuery.isFunction( data ) ) {
  4. type = type || callback;
  5. callback = data;
  6. data = null;
  7. }
  8. return jQuery.ajax({
  9. type: "GET",
  10. url: url,
  11. data: data,
  12. success: callback,
  13. dataType: type
  14. });
  15. },
Above is the jQuery.get method from ajax.js . I was wondering why the 4th line is

is

     
  1.  type = type || callback;

I think that line should be


        
  1.  type = callback;

The way I see it, if data is function then type *must* be nil . If type has a value
then one parameter before type must have been dropped.

Am I missing something here?