Not feeling smart enough about a particular topic is discouraging like you say. What is encouraging is that a language especially javascript is changing so fast we are all pushed back to the same starting line learning the new way of doing things. Having a good foundation about branching/looping, datatypes, writing clean code and testing will help you progress in programming.