Hacker News new | past | comments | ask | show | jobs | submit login

If you really want to reduce the amount of JavaScript you write for validation, you should be using the jQuery Form Validation plugin. I know it's an extra but who cares. It's totally flexible and you can validate your form in one line of code.

http://docs.jquery.com/Plugins/Validation/

But yeah, ternary operators are a great way to save line space.




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

Search: