vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
19 lines (18 loc) • 418 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Find the children of a given DOM element and return it as an Array
*
* @param elm - DOM element to find children from
* @return List of found child DOM elements
*
* @example
*
* ```ts
* children(someDiv);
* ```
*/
function children(elm) {
return Array.from(elm.children);
}
exports.default = children;