Extract a property value

    // extracts the floating number from an element's computed style property value

  1.     
  2.  let regex = /[+-]?\d+(\.\d+)?/g,
  3.    
  4. function getStyle(_element, _property){

  5.         let style = window.getComputedStyle(_element, null);
  6.         let prop = style.getPropertyValue(_property);
  7.         let v = prop.match(regex)||[0];
  8.          let val= v.map(function (v){return 1*v;});
  9.         return 1*(val);
  10.     }



msd