Como obter altura elegante com essa margem em JS

//get the margin of an element,
// {{ use the getComputedStyle() method  }}
let box = document.querySelector('div');  // my div
let style = getComputedStyle(box);        // my div style


// all side margin
let marginLeft = parseInt(style.marginLeft);
let marginRight = parseInt(style.marginRight);
let marginTop = parseInt(style.marginTop);
let marginBottom = parseInt(style.marginBottom);
Mehrshad Farzaneh