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

I suppose it works as a poor man's named argument. You still need to follow the argument order, but the code might be slightly more readable at the expense of creating random variables all over your code. The expression `a = 5` evaluates to 5 after all, which allows things like `a = b = c = d = 0` or the listed `let a = b = 5` which can cause confusion.


> I suppose it works as a poor man's named argument.

Sure, if by “poor man” you refer to the guy who has to debug that “code”. Name a variable with an existing or unwritable `window` property and enjoy.

Don’t do this stuff, use a linter and a decent editor that can do this automatically.


Moreover in a ESM, this could lead to an error whether base is not defined.




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: