FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.isIterable() function

boolean fcf.isIterable(mixed a_value)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Checks if an argument is iterable, but is not a string.

Arguments

mixed a_value
- Checked object
Result
boolean
- Returns true if the argument is iterable

Example: Function application

console.log(`[]: `, fcf.isIterable([])); console.log(`new Map(): `, fcf.isIterable(new Map())); console.log(`{}: `, fcf.isIterable({})); console.log(`"str": `, fcf.isIterable("str")); console.log(`1: `, fcf.isIterable(1)); console.log(`null: `, fcf.isIterable(null));

Output:

[]: true new Map(): true {}: false "str": false 1: false null: false