People may have different opinions on this question, but for me, passion really matters. I have five years back-end development experience, and now I am learning front end stuff. I just so love the feeling that I make something by my own and only back-end experience cannot help me do this.
At the same time, I also learnt machine learning and AI during last year. These are the buzzwords now and may take the world in the future, but I figure that it's difficult to do something interesting without considerable computation resources and big data (in general cases). Also, IMO, the most challenging part in ML is to investigate algorithms and improve them or even invent new ones, it is not only an engineering task but also a research question. As a software developer, I have to admit that I can use or understand the existing algorithms in general, but cannot further it, but I am open to change my opinion if one day the cost of playing with this stuff decreases. While for web development, it's all about engineering and I can know every detail of it if I want to.
Now my goal is to become a full stack developer and enjoy it. Today is web, tomorrow may move on to mobile. I feel It's not that difficult after I have several years of experience and thinking. By the way, it's exciting to get the chance to try different things.