Unfortunately the documentation has not caught up. In looking for examples and explanations I often find code written in the older syntax. Even worse it usually follows its own style guide. The first thing I do with a new example is to reformat it using the AirBnb style via ESLint. A friend turned me on to
eslint --fix as a tool to automate this a bit. Then I often have to refactor it to use the newer
const style variables over
var. This usually means thinking about and dealing with scoping issues. Once I have completed these steps I am usually in one of two states: joy or frustration. Reformatting the code usually makes it more comprehensible. If something fails to translate well to my style then I usually have to spend a lot of time figuring out the nuances of that problem.