Hacker News new | ask | show | jobs
by Lerc 4355 days ago
When teaching JavaScript to Kids about 10 years old. I tend to use x+=1 over x=x+1.

It seems to be much easier for people to attach the new construct += to to a new idea. I don't bring in the x=x+1 form until they have had plenty of use assigning other expressions to x. Kids don't seem to have any problem with x=y+1. They just need a little time for that idea to set properly before they start mixing things up.