Javascript generators notes