JavaScript generator