• Applies the given functions to the specified elements (or CSS rules).

    asComponent specifies whether the functions should be applied to each element. If falsy/not specified, all the elements are passed to the functions at once.

    Parameters

    • elements: Element | CSSRule | (Element | CSSRule)[]
    • functions: Function | Function[]
    • Optional asComponent: number | boolean

    Returns void

    Example

    applyTo(Array.from(document.body.children), (...bodyChildren) => console.log(bodyChildren.length));