UNPKG
is-iterable
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
Checks if a given object is iterable
github.com/hemanth/is-iterable
hemanth/is-iterable
is-iterable
/
index.js
6 lines
(5 loc)
•
189 B
JavaScript
View Raw
1
2
3
4
5
6
'use strict'
;
module
.
exports
=
function
(
val
) {
return
(
typeof
Symbol
!==
'undefined'
&&
Symbol
&&
'iterator'
in
Symbol
&& val !=
null
&&
typeof
val[
Symbol
.
iterator
] ===
'function'
); };