jsbeans.Iterator
(
object
,
[parserFunction]
)
- Parameters:
-
object <Object>
any object that supports thefor in
directive. -
[parserFunction] <Function>
a custom function to format each element returned bynext
.
parserFunction
will be called with property name as first argument and property value as second one.
If not set orparserFunction
is not a Function the default parser will be used (seenext
method).
Please, note that error handling is up to developer since thecatch
block on each step is empty.
To return a JSON in the format{name: itemName, value: itemValue}
usejsbeans.Iterator.JSON_FORMAT