From d59b170d50fdbbb166307de7027d6a685c822c11 Mon Sep 17 00:00:00 2001 From: nachtjasmin Date: Tue, 12 Sep 2023 13:52:34 +0200 Subject: [PATCH] Update JSDoc and simplify createElementWithClasses --- src/libs/hovercard/hovercard_helpers.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libs/hovercard/hovercard_helpers.js b/src/libs/hovercard/hovercard_helpers.js index f67a352..b99ed27 100644 --- a/src/libs/hovercard/hovercard_helpers.js +++ b/src/libs/hovercard/hovercard_helpers.js @@ -1,16 +1,13 @@ /** - * Creates a new HTML elmenent of the given tag name and the finite amount fo classes. + * Creates a new HTML elmenent of the given tag name and the finite amount of classes. * * @param {string} tagname - * @param {...string} classnames + * @param {string[]} classnames * @returns {HTMLElement} */ export function createElementWithClass(tagname, ...classnames) { const el = document.createElement(tagname); - for (const classname of classnames) { - el.classList.add(classname); - } - + el.classList.add(...classnames); return el; }