Number generator using javascript generators