"to like the idea of being able to avoid having to understand something"
Solution 1:
As @Barrie says, it's perfectly grammatical, if unduly convoluted.
In all honesty I'm not sure it's meaningful to retain all elements of the original. It's not clear, for example, whether the author is claiming that some people specifically like JavaScript because it allows them to avoid understanding all the details. Or if those people like the idea of not understanding, but in fact are compelled to understand anyway. Etc., etc.
In short, I think much of the sentence is just waffle. A shorter version might be...
JavaScript contains weird parts which some people would rather avoid.
Or maybe just Some people find JavaScript too complex.
Solution 2:
It's grammatical, but could probably be put in a way that makes it easier for the reader to understand. I won't try because I don't know the context.
Solution 3:
Some sentence structures are recursive, so they could in theory be extended forever:
The fascinating witches who put the scintilating stitches in the breeches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of King Caractacus, were just passing by.
Your sentence is another example of this; you can keep adding to it for as long as you like.
- some people like having to understand those parts.
- some people like avoiding having to understand those parts.
- some people like being able to avoid having to understand those parts.
- some people like the idea of being able to avoid having to understand those parts. (your sentence)
- some people like thinking about the idea of being able to avoid having to understand those parts.
- some people like the opportunity to think about the idea of being able to avoid having to understand those parts.
- some people like pursuing the opportunity to think about the idea of being able to avoid having to understand those parts.
- ... and so on
Of course, beyond a certain length, the sentence becomes difficult to follow. It's a matter of style. A good editor would probably shorten your example sentence, or break it into two sentences.
Solution 4:
Your grammar is fine, and the sentence was perfectly understandable to me, even before you provided more context. I admit that it is a bit convoluted, though, so many readers would have to stop and re-read the sentence before they could make sense of it.
JavaScript contains weird parts, and some people like [the idea of (being able to <avoid {having to understand those parts}>)].
To simplify it, you can probably omit the "idea of" part and still say more or less the same thing:
JavaScript contains weird parts and some people like being able to avoid having to understand those parts.
To be very clear about it, you could write something like
JavaScript contains weird parts, and some people like that CoffeeScript lets them avoid having to understand those parts.