Another functional solution in Typescriptusing arrow functions:
let el = document.querySelector('div'); let style = window.getComputedStyle(el); let height = ['height', 'padding-top', 'padding-bottom'] .map((key) => parseInt(style.getPropertyValue(key), 10)) .reduce((prev, cur) => prev + cur);