take for javascript generators