Concat nodelists and use forEach
method
referred from Stack Overflow
unactivate([...tabs, ...codes]);
activate([tab, code]);
function activate(elms) {
Array.prototype.forEach.call(elms, function(elm) {
elm.classList.add(CLASS_NAMES.ACTIVE);
})
}
function unactivate(elms) {
Array.prototype.forEach.call(elms, function(elm) {
elm.classList.remove(CLASS_NAMES.ACTIVE);
});
}