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

You can

    const x = min(a, b)
assuming a and b are const.


I can't think of a use case for that. If all the inputs are consts, then you know the values and can just assign it to be the less of a or b. Am I missing something here?


Const are build-time constants, they are not necessarily the same value across all build configurations.


That’s a good point.


> I can't think of a use case for that.

It helps to document intent.

Probably not so useful for min, but it can be more useful for more complex functions.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: