Well, after doing a lot of digging around, it looks like there really isn't a specific rule for this because there is little to no difference between the two. I think that the comments on your question confirm this...plenty of native speakers can't seem to find a distinction between the two.
So it looks like the "to" is completely optional. What is strange about this is that there doesn't seem to be much of a connotative difference between the two versions at all. Usually when something is optional, the different versions have some sort of connotative difference - possibly more formal or more colloquial. It doesn't seem like that is the case here to any extreme degree.
Both sentences below have the same meaning:
My goal here is to help you to learn to think in JavaScript.
and
My goal here is to help you learn to think in JavaScript.
I will say that I personally prefer the second option without the extra "to." I think this may be because the to-infinitive sounds slightly more formal, and in this case, since the writing style and topic seem on the informal side to me, leaving the "to" out (using the "bare infinitive") makes more sense to me.
BBC World Service's page on learning English confirms this:
The difference is one of form only. There is no difference in meaning. to-infinitive or bare infinitive
Help is a verb that can be used with or without to and with or without an object before the infinitive. When we use it without an infinitive it sometimes sounds more informal. Compare the following:
- Could you help me to look for my car keys? I can't find them anywhere.
- Could you help me look for my car keys? I can't find them anywhere.
- Would you like to help to cook dinner tonight? It's late and I'm feeling tired.
- Would you like to help cook dinner tonight? It's late and I'm feeling tired.
Here are a number of linkslinks that you can check out for more info on this (that appear to confirm what I've written above).