Want to understand a particular form of jquery syntax - Newbie Dumb question.

Want to understand a particular form of jquery syntax - Newbie Dumb question.

(function(global, factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], function($) {
          return factory($, global, global.document, global.Math);
        });
    } else if (typeof exports !== 'undefined') {
        module.exports = factory(require('jquery'), global, global.document, global.Math);
    } else {
        factory(jQuery, global, global.document, global.Math);
    }
})(typeof window !== 'undefined' ? window : this, function($, window, document, Math, undefined) {
    'use strict';

i downloaded a sample jquery project from web as i am new to jquery - to try out and understand the code flow and calls and syntax. I am breaking my head on the above syntax and not able to understand what it means.

i am a java programmer - i have never seen a function which starts within () and then it goes checking type of and some condition before defining the method body.

It would be nice if some one can explain me the syntax.
Thanks