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

++year;



    setYear(year => year + 1)
For the "get off my lawn" crew:

    $('#year').text(Number($('#year').text()) + 1)


don’t start the year by mutating state, geeeeeez :)


It's not mutating state, it's defining a transition function from one immutable state to another!


[year, setYear] = useState(2024)

Get off my lawn means no libraries, just web api.


year = year + 1




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: