Q:

What does this javascript code block means?

I came accross a code block in javascript. Can you please tell me its meaning?
var result = {
    diagmetric : diag * 2.54,
    sizex : xd,
    sizey : yd,
    metricsizex : 2.54*xd,
    metricsizey : 2.54*yd,
    xppi : x/xd,
    yppi : y/yd,
    dotpitch : pitch,
    sqppi : x/xd*y/yd
};

Full function : 
function calc_dpi (x,y,diag) {
    if (y == 0 || x == 0) return;
    var ratio = y/x;
    var xd = Math.sqrt( Math.pow(diag,2) / ( 1 + Math.pow(ratio, 2) ));
    var yd = xd * ratio;
    var pitch = 25.4/(x/xd); // metric
    var result = {
        diagmetric : diag * 2.54,
        sizex : xd,
        sizey : yd,
        metricsizex : 2.54*xd,
        metricsizey : 2.54*yd,
        xppi : x/xd,
        yppi : y/yd,
        dotpitch : pitch,
        sqppi : x/xd*y/yd
    };
    return result;
}

A:

Here you asign the Object to the result var. In JS you can define the fields in the object this way:
var obj = {fieldA:A, fieldB:B};

