How to get values from an element style with for-loop

Hi,

I have this code:

<span id="myelm" style="font-size: 40px;color: white;">test</span>

I want to get every style property and its value but as separate strings so I did this:

function doit() {
var styles = document.getElementById('myelm').style;
for(const style of styles) {
   console.log('style is'+style+' value is'+value);
  }
}

but I cant get only the property name. How do I get the value as a separate string as well?

https://jsfiddle.net/s6L0fh91/

Thank you.