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

Oh, your examples are better. Except for the break on the functional switch (that is weird again), they are how it should be done.

Is the example on the article wrong? A functional "if" shouldn't accept just one side of the branch, a functional switch shouldn't accept a "break", and although it's not absurd that a functional code block accepts a "return", it is not usual.



the break is part of a switch/case though?

https://www.w3schools.com/js/js_switch.asp




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: