JSONEncoder also supports iterables.