Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Calling send() with no arguments is functionally the same as calling .next(), but last I heard it would throw an error.

I just tried one in Firefox 17, and you can prime it by calling send() with no argument. It objects if there is an argument on the initial send().



Yeah this is a nice advantage of Javascript over Python:

send() is equivalent to send(undefined) which is equivalent to next().

This equivalence is true in Python as well, but you have to explicitly call send(None) which is annoying.


Ah, yes you're right.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: