Consider a simple JS function as
function test(property, color) {
var element = document.getElementById("test");
element.style.PROPERTY = color; // I want to use a variable for this command
}
In a typical JS command of element.style.PROPERTY, I want to introduce the property as a variable. This is a very basic example; what is the best approach to use variables in JS command lines?