values.forEach(value => {
if(element.value === value) element.selected = true;
});
if(values.includes(element.value)) element.selected = true;
About
PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce, PLSQL, Apache Velocity, XML, XSL.