html get class property

let element = document.querySelector('.preset');
let style = getComputedStyle(element);
let bg = style.backgroundColor;//get array of class names in Javascript
var classesArray = document.getElementById('myElementID').className.split(/\s+/);