UNPKG

@web3r/flowerkit

Version:

A collection of more than 60 often used utility JS functions that simplify frontend development.

14 lines (13 loc) 497 B
/** * Check if an object is iterable * @param obj{*} * @return {boolean} * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols * @example * // How to check for iterability? * const myDivs = document.querySelectAll("div"); * const isCanBeIterated = isIterable(myDivs); * console.log(isCanBeIterated); // => true */ const isIterable=obj=>obj===null?false:typeof obj[Symbol.iterator]==="function";export{isIterable}; //# sourceMappingURL=index.js.map