@web3r/flowerkit
Version:
A collection of more than 60 often used utility JS functions that simplify frontend development.
12 lines • 502 B
TypeScript
/**
* Gets last element of iterable object such as Array, NodeList, HTMLCollection, etc.
* @param obj{*}
* @return {*|null}
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
* @example
* // How to get last element from NodeList of `div`?
* const lastDiv = getLastFromIterable(document.querySelectorAll("div"));
* console.log(lastDiv) // => Node or null
*/
export function getLastFromIterable(obj: any): any | null;
//# sourceMappingURL=index.d.ts.map